高级玩家

- 贡献度
- 19
- 金元
- 2776
- 积分
- 354
- 精华
- 0
- 注册时间
- 2013-3-31
|
本帖最后由 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[j].def.dictionaryKey, this.m_quality,.......
改为
list.Add(new ItemStack(this.def.recycleItems_Okay[j].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版本
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
评分
-
1
查看全部评分
-
|