避难所2(Sheltered 2)DLL修改(V1.0.4版本)
本帖最后由 hzzyca 于 2021-10-6 16:30 编辑新开个贴子,随手记录一下自己修改避难所2(V1.0.4版本)的修改点,也方便给大家参考。
修改需要工具:dnspy
修改 游戏目录\Sheltered2_Data\Managed\Assembly-CSharp.dll 文件,修改前建议做好备份
需具备部分编程知识。
重要提示:
一般来说,我下面说的 找到 XX 方法,就是用dnspy 的 编辑方法(C#) 功能修改, 即在对应方法名称上点击右键,在弹出的菜单中选 编辑方法 (C#)
如果是修改 XX 字段 ,就要用 编辑类(C#)功能。
一、 种植相关
1.必出三星材料和种子 (种子50机会掉落)
找到Object_Planter 类下面的 HarvestPlant 方法
ItemStack itemStack = new ItemStack(this.m_plantType.dictionaryKey, (ItemStack.Quality)this.m_quality, 1, ItemStack.SpawnType.None);
ItemStack item = new ItemStack(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 = new ItemStack(this.m_seedType.dictionaryKey, ItemStack.Quality.Excellent, count, ItemStack.SpawnType.None);
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方法
if (currentTemperature < this.m_minTemperature || currentTemperature > this.m_maxTemperature)
{
一堆代码
}
else
改成
if (currentTemperature < this.m_minTemperature || currentTemperature > this.m_maxTemperature)
{
this.m_tempTime = 0f;
}
else
4.十倍生长速度
找到Object_Planter 类下面的 UpdatePlant方法
this.m_currentGrowTime += Time.deltaTime * num;
改成
this.m_currentGrowTime += Time.deltaTime * num * 10f;
5.解除种植类型限制
找到PlantManager类下面的 GetSeedList方法
可以找到两条contents.RemoveAt(i);
直接删掉第2条
二、仓库、人物负重
1.所有仓库容量放大50倍
找到ShelterInventoryManager 类的 RefreshMaxWeight() 方法:
num += this.m_allStorage.maxWeight ;
改为
num += this.m_allStorage.maxWeight * 50f;
找到ShelterInventoryManager 类的 UnregisterStorage() 方法:
float amount = this.m_inventory.maxWeight - storage.maxWeight ;
改为
float amount = this.m_inventory.maxWeight - storage.maxWeight * 50f;
对应前面放大的倍数,以免拆除柜子后容量计算错误
2.人物外出负重修改,人物每点力量加200负重。
找到Member 类下面的 GetCarryWeight 方法
float num = this.m_baseCarryingCapacity + (float)(base.baseStats.Strength.Level * 5);
改为
float num = this.m_baseCarryingCapacity + (float)(base.baseStats.Strength.Level * 200);
3.食物不腐烂
找到 Object_Base_WithStorage 类下面的 GetTemperature方法
把最后一个return this.xxxxxxx;改为
return -10f;
三、水源相关
1.水箱容量修改放大50倍
找到WaterManager类下面的 RefreshMaxWaterCapacity方法
this.waterStorageCapacity += this.m_waterContainers.storageCapacity ;
改为
this.waterStorageCapacity += this.m_waterContainers.storageCapacity * 50f;
2.雨水过滤效率500倍
找到Object_WaterFilter类下面的 m_waterFilteringEfficiency字段
private float m_waterFilteringEfficiency = 1f;改为
private float m_waterFilteringEfficiency = 500f;
3.污水自动增长和快速处理
找到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;
}
在没有污水时每6秒自动增加1点污水
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);
每次6秒净化1点污水,得200净水
四、设备、物品相关
1.设备耐久1000,降低损耗速度50倍
找到Object_Integrity类
修改字段:
private float m_degradeRatePerGameHour = 5f;
改成
private float m_degradeRatePerGameHour = 0.1f;
耐久降低速度减少50倍
protected float m_integrity = 100f;
private float m_maxIntegrity = 100f;
改成
protected float m_integrity = 1000f;
private float m_maxIntegrity = 1000f;
初始设备耐久和最大耐久改为1000 ( 需新开档)
在 SetMaxIntegrity 方法中:
this.m_maxIntegrity = Mathf.Clamp((float)value, 5f, 100f);
改为
this.m_maxIntegrity = Mathf.Clamp((float)value, 1000f, 1100f);
自制设备耐久上限修改为1000(原有设备不变,新建造的设备才有效)
2.所有制作物品三星
找到CraftingManager类下面的 GetCraftQuality方法
把 {} 的内容直接改成:return 2;
3.拆解出三星材料
找到ObjectInteraction_DeconstructObject类下面的 FinishInteraction方法
int qual = 0;
改成
int qual = 2;
拆垃圾出三星材料
int qual2 = 0;
改成
int qual2 = 2;
拆机器人出三星材料
int qual3 = 0;
改成
int qual3 = 2;
拆物品出三星材料
找到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, ItemStack.SpawnType.None));
找到ItemStack类下面的 GetRecycleItems方法
把3条 list.Add(new ItemStack(this.def.recycleItems_Okay.def.dictionaryKey, this.m_quality,.......
改为
list.Add(new ItemStack(this.def.recycleItems_Okay.def.dictionaryKey,ItemStack.Quality.Excellent,.......
回收出三星材料
五、耗电修改
1.耗电量降低100倍
找到Object_Powered类下面的SetPowerRequiredPerGameHour方法
this.m_powerRequiredPerRealSecond = this.m_powerRequiredPerGameHour / (TimeManager.secondsInGameDay / 24f);
改为
this.m_powerRequiredPerRealSecond = this.m_powerRequiredPerGameHour / (TimeManager.secondsInGameDay / 2400f);
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(20f * this.m_maxOutputPossible, this.m_maxOutputPossible*100f , this.m_maxOutputPossible*20f);
六、动作加快
1.秒睡+快速疗伤
找到ObjectInteraction_Sleep类下面的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 / 10000f * num2;
this.m_restAmountPerSecond = 10000f / num2;
this.m_healAmountPerSecond = 10000f / num3;
睡眠效率翻了100倍,疗伤速度100倍
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 = 1f;
改为
this.m_repairPerSecond = 100f;
100倍快速修理
找到ObjectInteraction_RepairItem类下面的 GetSpeedMulti方法
return num;
改为
return num + 10f;
10倍快速修理物品
找到ObjectInteraction_RepairWeapon 类下面的 GetSpeedMulti方法
return num;
改为
return num + 10f;
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倍清理桌子和发电机等物品
3.工作疲劳值增长降低100倍
找到ObjectInteraction_Base类
把
protected float m_fatigueRateMultiplier = 1f;
protected float m_FatigueRate = 1f;
改为
protected float m_fatigueRateMultiplier = 0.1f;
protected float m_FatigueRate = 0.1f;
4.10倍快速打扫
找到Job_CleanShelter类下面的 UpdateJob方法
this.currentCleanTimer -= Time.deltaTime * 1f ;
改为
this.currentCleanTimer -= Time.deltaTime * (this.GetSpeedMulti() + 10f);
七、人物相关
1. 经验上限40即满
找到BaseStat类
修改ExpLevel 字段
改成:
{
0,
10,
20,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40,
40
};
40点经验满级
2. 经验上限40即满找到BaseStat类
修改skillPointsPerLevel 字段
改成:
{
0,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11,
11
};
每级给11点技能点
3.强制锻炼、读书学习(修正卡经验导致锻炼、学习无法升级问题)
找到ObjectInteraction_Exercise类下面的 BeginInteraction 方法
this.totalXpFortitude = 0;
。。。。
this.interactionLength = (float)memberRH.member.baseStats.GetStatByEnum(this.exer.Stat).GetRemainingExpValue() / (float)this.m_experienceGain / (this.m_higherThanMax ? 0.1f : 1f);
改成
this.totalXpFortitude = 1000;
。。。。
this.interactionLength = 60f;
强制锻炼60秒,耐力经验1000倍
找到ObjectInteraction_ReadCharismaBook 、 ObjectInteraction_ReadIntelligenceBook 、 ObjectInteraction_ReadPerceptionBook类下面的 BeginInteraction 方法
把
this.interactionLength = xxxxxxxxxxx
改成
this.interactionLength = 60f;
强制读书学习60秒
4.行走速度加快(建议2倍速,快了容易卡)
找到MemberNavigation类下面的 GetWalkSpeed方法
return this.m_walkSpeed*this.m_walkSpeedTraitMultiplier*this.m_walkSpeedMultiplier;
改为
return this.m_walkSpeed * this.m_walkSpeedTraitMultiplier * this.m_walkSpeedMultiplier * 2f;
八、探险、任务相关
1.轻松完成抓捕任务,任意囚犯就可以交任务
找到JobStage_CheckCaptives类下面的 CaptiveCheck方法
return xxxx;
改为
return SlaveManager.instance != null && SlaveManager.instance.CurrentSlaves.Count > 0;
2.直接完成救人任务
找到JobStage_CheckCaptives类下面的 CanStart方法
if (this.m_job == null || this.m_job.CurrentMapTile == null)
{
Debug.LogError("MapTile not found");
return false;
}
return !this.m_job.CurrentMapTile.HasHostage;
改为
if (this.m_job == null || this.m_job.CurrentMapTile == null)
{
Debug.LogError("MapTile not found");
return true;
}
return !this.m_job.CurrentMapTile.HasHostage || this.m_job.CurrentMapTile.HasHostage;
3.搜索、捕猎等加速
找到Party类下面的 Update_Foraging方法
this.m_forageTimer -= Time.deltaTime;
改为
this.m_forageTimer -= Time.deltaTime * 10f;
采集加速
找到Party类下面的 Update_GeneratingResource方法
this.m_currentActionTimer -= Time.deltaTime * this.m_workingTimerModifier;
改为
this.m_currentActionTimer -= Time.deltaTime * this.m_workingTimerModifier * 10f;
生产资源加速
找到Party类下面的 Update_Hunting方法
this.m_huntTimer -= Time.deltaTime;
改为
this.m_huntTimer -= Time.deltaTime * 10f;
打猎加速
找到Party类下面的 Update_SearchingPOI方法
this.m_currentActionTimer -= Time.deltaTime;
改为
this.m_currentActionTimer -= Time.deltaTime * 10f;
搜索加速
找到Party类下面的 Update_Traveling方法
this.m_distanceTravelledToTile += Time.deltaTime;
this.m_timeToNextAction += Time.deltaTime;
改为
this.m_distanceTravelledToTile += Time.deltaTime * 10f;
this.m_timeToNextAction += Time.deltaTime * 10f;
移动加速
改好的DLL, 只适用于1.0.4版本
大佬 直接报错了 能不能发个改好的文件谢谢 不行啊 按大佬的数值修改完 游戏都进不去了 大佬给个修改好的文件吧 不是全部人都有大佬的技术 耗电量降低有个小bug,4星物品的aed充电速度会变得非常慢…… M___M__Metatron 发表于 2021-10-4 05:05
大佬 直接报错了 能不能发个改好的文件谢谢
报错的话请检查下游戏版本,菜单页面右下角有标注,论坛版本是1.0.0的,bug太多我已经不用了,我现在用的1.0.4版本
snoopy3841 发表于 2021-10-4 12:05
耗电量降低有个小bug,4星物品的aed充电速度会变得非常慢……
充电速度跟耗电量有关,你可以不改耗电量,单改风车电量输出,多建几个风车就够了
sosogou 发表于 2021-10-4 11:24
不行啊 按大佬的数值修改完 游戏都进不去了 大佬给个修改好的文件吧 不是全部人都有大佬的技术 ...
发了改好的文件,但用之前请确认游戏版本为1.0.4
谢谢 大哥 指教 66666666666666
感谢分享{:3_121:}详细的介绍,比丢个文件出来高级多了 谢谢分享 我的版本是最新的但是打不开设置每次要打开都得steam查一下错才行 总体相当赞的文件,但是在1.07游戏里无法调出设置界面。所以无法手动保存游戏,而且在点击设置以后导致游戏崩溃 这游戏好玩。地图物资收集速度好像是寻Start_SearchingPOI
this.m_currentActionTimerMax = ((this.m_currentTile.poi != null) ? this.m_currentTile.poi.searchTimeInRealSeconds : 3f) / 10f;
this.m_currentActionTimer = this.m_currentActionTimerMax / 10f; ZOX 发表于 2021-10-5 06:36
这游戏好玩。地图物资收集速度好像是寻Start_SearchingPOI
this.m_currentActionTimerMax = ((this.m_cur ...
我倒是觉得游戏还不如改文件来的有意思,:lol
话说这游戏的程序虽然写的bug多多,但其实可读性还行,最近我一直在找拯救任务无法完成的问题所在,不过还没有最终定位到具体代码,不知道有没有大神指点一下:lol
本帖最后由 hzzyca 于 2021-10-6 03:23 编辑
更新了快速打扫避难所等新的内容,已测试通过有效:lol 本帖最后由 SouLjie 于 2021-10-6 01:59 编辑
hzzyca 发表于 2021-10-6 00:53
更新了快速打扫避难所的内容,已测试通过有效
感谢你的努力 SouLjie 发表于 2021-10-5 04:00
总体相当赞的文件,但是在1.07游戏里无法调出设置界面。所以无法手动保存游戏,而且在点击设置以后导致游戏 ...
我这个dll只能用于正式版的1.0.4,你的那个1.07应该是测试版,不能用 已经解决救人任务无法完成的问题,经过仔细排查,确认是原程序代码里,生成任务地点的部分存在问题,导致无法正常生成任务地点,等我解决了这个问题,发现即使救人成功,后续处理也有问题,所以我干脆修改对话,可以强制完成任务。 hzzyca 发表于 2021-10-6 16:34
已经解决救人任务无法完成的问题,经过仔细排查,确认是原程序代码里,生成任务地点的部分存在问题,导致无 ...
Patch Notes
1.0.7
[*]Fixed null reference on Options Panel which was freezing the game
[*]Correct experience will now be given when using exercise equipment, stopping characters with the Slow Learner weakness trait getting stuck at 1xp
[*]Stats which have been modified by mental and physical conditions will now display the unmodified value in brackets after the current level
[*]Possible fix for headbutt not dazing
[*]Fixed issue where main storage and pantries would display each other’s contents
[*]Fixed broken upgrades on Water Purifier and Water Filter objects. Water Purifier also now displays max water capacity in tooltip
[*]Possible fix for characters becoming stuck on expeditions
[*]Fixed issue where the player’s characters could get stuck carrying a corpse
[*]Fixed issue with medical items duplicating after a breach
[*]Fixed issue where characters sleeping in beds would register as being in another room, causing them to become hot or cold (if the temp was too low or high in the other room)
[*]Fixed an issue where items could be lost when using the Take All button after using the filter options on the item transfer screen
[*]Locations now restock items
[*]1 item every 48 hours (once visited for the first time)
[*]Petrol spawn chance increased at Petrol Stations
[*]Added checks to quest spawning to check if destination is valid
1.0.6
[*]Fixed issue stopping you completing Rescue jobs
[*]Fixed an issue where the difficulty of regions would permanently increase
[*]Should also repair saves which have been affected by this issue
[*]Fixed some power system issues to do with objects not being powered correctly and displaying the wrong power status
[*]Possible fix for NPCs performing multiple attacks
[*]Fixed issue where negative mood modifiers from physical and mental conditions are not removed when cured
[*]Fixed issue with infections not passing over time
[*]Fixed issue where prisoners would move into another cell upon loading a save
[*]Fixed issue with loading into a game where a prisoner was the currently selected member
[*]Can no longer perform a trade if you have exceeded your weight capacity. Stops traded items disappearing
[*]Fixed issues with trying to build rooms on the bottom layer of the shelter
1.0.5
[*]Fixed issue where faction members would become stuck when pathing to become unconscious after loading a save
[*]Fixed an issue where visitors to the shelter would stop spawning
[*]Fixed issue with the temperatures in Autumn
[*]Fixed issue where faction encounters would stop spawning after day 100
[*]直接升级一下不好么。。。。。都出了这么多补丁了
谢谢分享,楼主厉害了,这就去试试 hzzyca 发表于 2021-10-4 14:36
报错的话请检查下游戏版本,菜单页面右下角有标注,论坛版本是1.0.0的,bug太多我已经不用了,我现在用的 ...
大佬,1.0.4版本有资源吗,到哪里下载。
kirito26845 发表于 2021-10-19 14:12
大佬,1.0.4版本有资源吗,到哪里下载。
外网出了1.0.9版本GOG版,可以玩
hzzyca 发表于 2021-10-20 11:46
外网出了1.0.9版本GOG版,可以玩
我也在外网找到了。不知道大佬能不能找到初始水箱,更衣柜(Locker),还有食品柜(pantry)那个控制他们不能拆除的函数,还有控制食品柜容量大小的函数
本帖最后由 hzzyca 于 2021-10-21 10:32 编辑
kirito26845 发表于 2021-10-20 23:55
我也在外网找到了。不知道大佬能不能找到初始水箱,更衣柜(Locker),还有食品柜(pantry)那个控制他们不能 ...
初始设施都不能拆除,貌似拆除了会出错。 箱子容量修改了,食品柜的容量跟着会变动的。
我刚测试了一下,104 跟109两个版本的修改基本通用,不怎么需要修改
hzzyca 发表于 2021-10-21 10:25
初始设施都不能拆除,貌似拆除了会出错。 箱子容量修改了,食品柜的容量跟着会变动的。
我刚测试了一下, ...
在哪里能修改狩猎奖励的星级
kirito26845 发表于 2021-10-21 19:51
在哪里能修改狩猎奖励的星级
狩猎收获修改:
在 ControlRegion 类下面的 GetHuntedRewards 方法里
把
list.Add(new ItemStack("meat", (ItemStack.Quality)num2 , 1, ItemStack.SpawnType.None));
...
list.Add(new ItemStack("Leather", (ItemStack.Quality)num2 , 1, ItemStack.SpawnType.None));
...
list.Add(new ItemStack("animalFat", (ItemStack.Quality)num2 , 1, ItemStack.SpawnType.None));
...
改成
list.Add(new ItemStack("meat", ItemStack.Quality.Excellent, 51, ItemStack.SpawnType.None));
....
list.Add(new ItemStack("Leather", ItemStack.Quality.Excellent, 51, ItemStack.SpawnType.None));
....
list.Add(new ItemStack("animalFat", ItemStack.Quality.Excellent, 51, ItemStack.SpawnType.None));
....
收获的肉、皮、脂肪品质3星,数量增加50倍
采集收获修改:
在 ControlRegion 类下面的 GetForagingRewards方法里
把
list.Add(new ItemStack(allItemsByType.dictionaryKey, (ItemStack.Quality)num2 , 1, ItemStack.SpawnType.None));
改成
list.Add(new ItemStack(allItemsByType.dictionaryKey, ItemStack.Quality.Excellent, 51, ItemStack.SpawnType.None));
收获品质3星,数量增加50倍
探险队装备耐久磨损减少100倍
在 itemStack 类下面的 UseEquipment方法里
this.SetIntegrity(this.integrity - 100f * this.def.GetQualityStats(this.m_quality).m_integrityValue);
改成
this.SetIntegrity(this.integrity - 10000f * this.def.GetQualityStats(this.m_quality).m_integrityValue);
装备耐久损耗减少100倍
外出探险
进入战斗时,无食物不减行动力
在 CombatManager类下面的 EnterState_SettingUp 方法里
bool flag2 = this.m_currentParty != null && this.currentParty.rations <= 0f;
改成
bool flag2 = this.m_currentParty != null; 厉害啊,大佬一定是个编程大佬 本帖最后由 510000912 于 2021-10-28 23:39 编辑
hzzyca 发表于 2021-10-21 10:25
初始设施都不能拆除,貌似拆除了会出错。 箱子容量修改了,食品柜的容量跟着会变动的。
我刚测试了一下, ...
大佬,我用dnspy修改时点编译他总是报这个错,是我的版本问题吗
页:
[1]
2