本帖最后由 hzzyca 于 2021-11-4 17:42 编辑
目前避难所2(Sheltered 2)正式版已更新至v1.0.10版本,游戏有了较大变动,修正了不少的bug,之前V1.0.4版本的修改已不再适用,所以新开个贴子记录现在的修改点,也方便给大家参考。 修改需要工具:dnspy 修改 游戏目录\Sheltered2_Data\Managed\Assembly-CSharp.dll文件,修改前建议做好备份 需具备部分编程知识。 重要提示: 一般来说,我下面说的 找到 XX方法,就是用dnspy 的 编辑方法(C#) 功能修改, 即在对应方法名称上点击右键,在弹出的菜单中选 编辑方法 (C#) 如果是修改 XX 字段 ,就要用 编辑类(C#) 功能。 附件提供了修改好的文件供大家使用,部分修改数值有做调整。对不喜欢关注细节的同学可以直接文末下载DLL文件。 一、 种植、陷阱相关 1.必出三星材料和种子 找到Object_Planter 类下面的 HarvestPlant 方法 ItemStack itemStack= new ItemStack(this.m_plantType.dictionaryKey, (ItemStack.Quality)this.m_quality,1, ItemStack.SpawnType.None); 。。。。 ItemStack item = newItemStack(this.m_seedType.dictionaryKey, (ItemStack.Quality)this.m_quality, count,ItemStack.SpawnType.None); 改为 ItemStack itemStack= new ItemStack(this.m_plantType.dictionaryKey, ItemStack.Quality.Excellent, 1,ItemStack.SpawnType.None); 。。。 ItemStack item = newItemStack(this.m_seedType.dictionaryKey, ItemStack.Quality.Excellent, count, ItemStack.SpawnType.None); 把 if (UnityEngine.Random.value > 0.5f) 改成 if (UnityEngine.Random.value > 0f) 100%机会掉落种子 2.作物无需浇水 找到Object_Planter 类下面的 UpdatePlant方法 this.m_currentWaterLevel= Mathf.Max(this.m_currentWaterLevel - Time.deltaTime * this.WaterDeclinePerSecond, 0f); 改为 this.m_currentWaterLevel= 100f; 3. 作物无视温度生长 找到Object_Planter 类下面的 UpdatePlant方法 float currentTemperature = base.currentArea.CurrentTemperature; 改成 float currentTemperature = this.m_minTemperature; 4. 作物5倍生长速度 找到Object_Planter 类下面的 UpdatePlant方法 this.m_currentGrowTime+= Time.deltaTime * num; 改成 this.m_currentGrowTime+= Time.deltaTime * num * 5f; 5.解除种植类型限制 找到PlantManager类下面的 GetSeedList方法 可以找到两条 contents.RemoveAt(i); 直接删掉第2条 6.陷阱捕猎几率修改 找到WildlifeMovement类下面的 AttemptToNibble方法 if (UnityEngine.Random.value < 0.4f) 改成 if (UnityEngine.Random.value < 0.9f) 上套机会90% 7.陷阱可用次数不减 找到Object_SnareTrap类下面的 UseTrap方法 this.m_uses--; 改成 this.m_uses=3; 二、仓库、物品相关 1. 物品仓库容量修改 找到ShelterInventoryManager 类的 RefreshMaxWeight() 方法: num += this.m_allStorage.maxWeight; 改为 num += this.m_allStorage.maxWeight* 50f; 普通物品容量放大50倍,无需重开游戏即可生效。 2.水箱容量修改 找到WaterManager类下面的 RefreshMaxWaterCapacity方法 this.waterStorageCapacity+= this.m_waterContainers.storageCapacity ; 改为 this.waterStorageCapacity+= this.m_waterContainers.storageCapacity * 50f; 水箱容量放大50倍,无需重开游戏即可生效。 3. 食品柜、药品柜容量修改 找到Object_Base_WithStorage类的 Awake方法: base.Awake();
改为 base.Awake();
this.m_maxWeight *= 50f; 食品柜、药品柜容量放大50倍,需新制作的才有效,原有柜子不生效,新开游戏的话初始柜子也有效。与上述两个修改效果不叠加。 物品重量缩小10倍(不建议使用,容易有bug) 找到ItemStack类的 GetStackWeight() 方法: return (float)Mathf.RoundToInt(this.m_def.weight * (float)this.amount * 10f) / 10f; 改为 return (float)Mathf.RoundToInt(this.m_def.weight * (float)this.amount * 10f) / 100f; 4.食物不腐烂 找到 Object_Base_WithStorage 类下面的 GetTemperature方法 把最后一个return this.xxxxxxx;改为 return -10f; 5.雨水过滤效率500倍 找到Object_WaterFilter类下面的 update方法 base.Update(); 改为 base.Update(); this.m_waterFilteringEfficiency= 500f; 6.污水自动增长和快速处理 找到Object_WaterPurifier类下面的 Update 方法 if (this.m_storedWater< 1f) { this.m_purifyTimer = this.m_purifySpeed; return; } 改为 if (this.m_storedWater< 1f) { this.m_purifyTimer = this.m_purifySpeed/ 10f; this.AddContaminatedWater(1f); return; } 把 this.m_purifyTimer = this.m_purifySpeed; WaterManager.instance.AddWater(1f, false); this.RemoveContaminatedWater(1f); 改为 this.m_purifyTimer = this.m_purifySpeed / 10f; WaterManager.instance.AddWater(200f, false); this.RemoveContaminatedWater(1f); 每次10秒净化1点污水,得200净水。在没有污水时每20秒自动增加1点污水。 三、设备、物品相关 1.降低设备损耗速度50倍 找到Object_Integrity类下面的 UpdateIntegrity方法 把 if (this.m_integrityReductionType == Object_Integrity.IntegrityReductionType.Never) 改成 this.m_degradeRatePerGameHour= 0.02f; if (this.m_integrityReductionType == Object_Integrity.IntegrityReductionType.Never) 耐久降低速度减少50倍 2. 设备耐久上限修改(两种方法二选一) 在 SetMaxIntegrity 方法中: this.m_maxIntegrity= Mathf.Clamp((float)value, 5f, 100f); 改为 this.m_maxIntegrity= Mathf.Clamp((float)value, 1000f, 1100f); 自制设备耐久上限修改为1000(原有设备不变,新建造的设备才有效) 在 Repair 方法中: if (this.m_isBroken) 改为 this.m_maxIntegrity=1000f; if (this.m_isBroken) 每次维修时将设备耐久上限设为1000,对原有设备也有效,跟前面耐久上限修改二选一即可。 3.制作物品修改 找到CraftingManager类下面的 FinishInteraction方法 ShelterInventoryManager.instance.AddItems(new ItemStack(dictionaryKey, (ItemStack.Quality)qual, 1, ItemStack.SpawnType.None), false); 改成: ShelterInventoryManager.instance.AddItems(new ItemStack(dictionaryKey, ItemStack.Quality.Excellent, 10, ItemStack.SpawnType.None), false); 制作物品三星,10倍产量 4.回收物品修改 两处地方需要修改: 一是找到ItemStack类下面的 GetSpecificRecycleItems方法 把 list2.Add(new ItemStack(itemStack.def.dictionaryKey,itemStack.quality, itemStack.amount * customAmount, ItemStack.SpawnType.None)); 改为 list2.Add(new ItemStack(itemStack.def.dictionaryKey,ItemStack.Quality.Excellent, itemStack.amount * customAmount*10, ItemStack.SpawnType.None)); 二是找到ItemStack类下面的 GetRecycleItems方法 list.Add(new ItemStack(this.def.recycleItems_Poor.def.dictionaryKey… 。。。 list.Add(new ItemStack(this.def.recycleItems_Okay[j].def.dictionaryKey… 。。。 list.Add(new ItemStack(this.def.recycleItems_Good[k].def.dictionaryKey… 改成list.Add(new ItemStack(this.def.recycleItems_Poor.def.dictionaryKey, ItemStack.Quality.Excellent, this.def.recycleItems_Poor.amount * customAmount * 10, ItemStack.SpawnType.None)); 。。。 list.Add(new ItemStack(this.def.recycleItems_Okay[j].def.dictionaryKey, ItemStack.Quality.Excellent, this.def.recycleItems_Okay[j].amount * customAmount * 10, ItemStack.SpawnType.None)); 。。。 list.Add(new ItemStack(this.def.recycleItems_Good[k].def.dictionaryKey, ItemStack.Quality.Excellent, this.def.recycleItems_Good[k].amount * customAmount * 10, ItemStack.SpawnType.None)); 回收出三星材料,数量10倍 四、电器类修改 1.耗电量降低100倍 找到Object_Powered类下面的SetPowerRequiredPerGameHour方法 this.m_powerRequiredPerGameHour = amount; 改为 this.m_powerRequiredPerGameHour = amount / 100f; 2.风车恒定20倍最大功率输出 找到Object_WindTurbine类下面的 Update 方法 this.m_outputPerSecond= Mathf.Clamp(this.m_currentSpeed / this.m_maxRotationSpeed * this.m_maxOutputPossible,0f, this.m_maxOutputPossible); 改为 this.m_outputPerSecond= Mathf.Clamp(this.m_maxOutputPossible*20f, this.m_maxOutputPossible*20f , this.m_maxOutputPossible*100f); 3.发电机燃料零消耗 找到Object_PowerSourceWithStorage类下面的FuelToBurnHours方法 return fuel / PowerManager.instance.GetHourlyPowerUsage() * base.efficiencyPercent; 改成 return 0f; 4.制冷、制暖效果修改 找到Object_AirCon类下面的CalculateHeatEmission方法 base.currentArea.additionalHeat += Mathf.Max(-num, this.m_heatEmissionPerHour); 改成 base.currentArea.additionalHeat += Mathf.Max(-num, this.m_heatEmissionPerHour)*50f; 制冷效果50倍,所有风扇、空调通用。 找到Object_Heater类下面的CalculateHeatEmission方法 base.currentArea.additionalHeat += Mathf.Min(this.targetTemp - (base.currentArea.CurrentTemperature + base.currentArea.LeakedHeatPerHour), this.m_heatEmissionPerHour); 改成 base.currentArea.additionalHeat += Mathf.Min(this.targetTemp - (base.currentArea.CurrentTemperature + base.currentArea.LeakedHeatPerHour), this.m_heatEmissionPerHour)*50f; 制暖效果50倍,所有电暖器通用,不适用1级的取暖火炉和焚烧炉。 5.油灯修改 找到Object_Lantern类下面的Update方法 this.m_fuelLevel -= Time.deltaTime * (1f / this.m_fuelBurnTime); 改成 this.m_fuelLevel -= Time.deltaTime * (1f / this.m_fuelBurnTime)*0.1f; 油脂消耗减少10倍 五、动作加快 1.秒睡+快速疗伤 找到ObjectInteraction_Sleep , ObjectInteraction_SleepBunkBed类下面的BeginInteraction方法 this.interactionLength= memberRH.member.needs.fatigue.Value / 100f * num2; this.m_restAmountPerSecond= 100f / num2; this.m_healAmountPerSecond= 100f / num3; 改为 this.interactionLength= memberRH.member.needs.fatigue.Value / 1000f * num2; this.m_restAmountPerSecond= 1000f / num2; this.m_healAmountPerSecond= 1000f / num3; 睡眠效率翻了10倍,疗伤速度10倍 2.各种工作速度提升 找到ObjectInteraction_ConstructObject类下面的 GetSpeedMulti方法 return num; 改为 return num + 10f; 10倍快速建筑 找到ObjectInteraction_CraftItem类下面的 GetSpeedMulti方法 return num; 改为 return num + 10f; 10倍快速制作 找到ObjectInteraction_Repair类下面的 BeginInteraction方法 this.m_repairPerSecond= 1.5f; 改为 this.m_repairPerSecond= 100f; 100倍快速修理 找到ObjectInteraction_RepairItem类下面的 GetSpeedMulti方法 return num; 改为 return num + 10f; 10倍快速修理物品 找到ObjectInteraction_RepairWeapon 类下面的UpdateInteraction方法 interactionTimers[getID] += 1f * Time.deltaTime; 改为 interactionTimers[getID] += 10f * Time.deltaTime; 10倍快速修理武器 找到ObjectInteraction_DeconstructObject类下面的 GetSpeedMulti方法 return num; 改为 return num + 10f; 10倍快速拆除设备 找到ObjectInteraction_Dismantle类下面的 GetSpeedMulti方法 return num; 改为 return num + 10f; 10倍快速回收物品 找到ObjectInteraction_CleanObject类下面的 GetSpeedMulti方法 return num; 改为 return num + 10f; 10倍清理桌子和发电机等物品 找到ObjectInteraction_Excavate类下面的 GetSpeedMulti方法 return num; 改为 return num + 10f; 10倍速挖掘新房间 3.工作疲劳值增长降低100倍 找到ObjectInteraction_Base类下面的 ApplyFatigue方法 把 this.m_FatigueAccumulator += this.FatigueRate * this.m_fatigueRateMultiplier * Time.deltaTime ; 改为 this.m_FatigueAccumulator += this.FatigueRate * this.m_fatigueRateMultiplier * Time.deltaTime *0.01f; 4.快速打扫 找到Job_CleanShelter类下面的 UpdateJob方法 this.currentCleanTimer-= Time.deltaTime * 1f ; 改为 this.currentCleanTimer-= Time.deltaTime * (this.GetSpeedMulti() + 10f); 清洁效率10倍,但人物动作速度不变。 六、人物相关 1. 经验及技能点修改 找到BaseStat类下面的 IncreaseExp方法(有两个,同样修改) 把 if (this.experience >= BaseStat.ExpLevel[this.level + 1]) 。。。。 if (this.experience >= BaseStat.ExpLevel[i + 1]) 改成: if ((this.experience*50) >= BaseStat.ExpLevel[this.level + 1]) 。。。。 if ((this.experience*50) >= BaseStat.ExpLevel[i + 1]) 升级所需经验减少50倍 把两条 this.professionSkillPoints += BaseStat.skillPointsPerLevel[this.level]; 改为 this.professionSkillPoints += BaseStat.skillPointsPerLevel[this.level]+10; 每次升级多给10点技能点 2.提高人物属性上限的实验修改 找到ObjectInteraction_Experiment类下面的 FinishInteraction方法 float num = 0.25f; 改成 float num = 0.8f; 实验成功几率80 找到BaseStat类下面的 Experiment方法 this.m_experimented = true; 改为 this.m_experimented = false; 实验次数无限 3.锻炼经验修改 找到ObjectInteraction_Exercise类下面的UpdateInteraction 方法 this.totalXpNeo = Mathf.Min(this.timer, this.interactionLength) * (float)this.m_experienceGain;
this.totalXpFortNeo = Mathf.Min(this.fortitudeTimer, this.interactionLength) * (float)this.m_experienceGain * 0.75f; 改成 this.totalXpNeo = Mathf.Min(this.timer, this.interactionLength) * (float)this.m_experienceGain*10f;
this.totalXpFortNeo = Mathf.Min(this.fortitudeTimer, this.interactionLength) * (float)this.m_experienceGain * 0.75f*10f; 锻炼的属性经验和耐久经验10倍,目前游戏的经验计算机制修改了,锻炼过程中不显示经验变化,可以等人物锻炼一段时间后手动取消,系统就会自动计算所获经验,不需要等待整个锻炼动作全部完成。 4.读书经验修改 找到ObjectInteraction_ReadCharismaBook 、 ObjectInteraction_ReadIntelligenceBook 、 ObjectInteraction_ReadPerceptionBook类下面的 UpdateInteraction 方法,修改方法一样: 把 int num = this.m_experienceGain * this.characterLevel; 改成 int num = this.m_experienceGain * this.characterLevel*10; 读书学习经验10倍 5.行走速度加快(建议2倍速,快了容易卡) 找到MemberNavigation类下面的 GetWalkSpeed方法 return this.m_walkSpeed*this.m_walkSpeedTraitMultiplier*this.m_walkSpeedMultiplier; 改为 return this.m_walkSpeed * this.m_walkSpeedTraitMultiplier* this.m_walkSpeedMultiplier * 2f; 6.强制解除人物卡死状态修改 找到ObjectInteraction_AddFat类下面的 OnInteractionSelected方法 把 InteractionManager.instance.SelectedMember.member.AddJob(new Job(InteractionManager.instance.SelectedMember, base.obj, this, base.obj.GetInteractionTransform(0, false), false, 0f, 0f)); 改成 InteractionManager.instance.SelectedMember.member.FinishInteracting();
InteractionManager.instance.SelectedMember.member.AddJob(new Job(InteractionManager.instance.SelectedMember, base.obj, this, base.obj.GetInteractionTransform(0, false), false, 0f, 0f)); 只要选择给油灯加油,就会强制解除人物当前卡死动作。 7. 心理咨询、手术成功几率修改 找到ObjectInteraction_Therapy、ObjectInteraction_Surgery类下面的 FinishInteraction方法 float num = 0.5f; 改为 float num = 0.8f; 成功几率提高至80%
附件:修改好的文件,部分数值有调整,不会过于imba
|