3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 6000|回复: 2
打印 上一主题 下一主题

[MOD] 针对6号升级档的各种mod

[复制链接]

63

主题

975

帖子

3333

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
420
金元
16225
积分
3333
精华
3
注册时间
2014-11-13

3DM MOD站(黄金)

跳转到指定楼层
主题
发表于 2018-1-20 20:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 qweytr_1 于 2018-1-21 22:03 编辑

首先,由于各个mod都需要修改同一个文件,这里只提供几种可能,想实现这些可能排列组合的请百度ilspy,反正我的代码已经放上来了。
其一,移动加速mod
说明:本作对移动计算相当复杂,移动方法有很多,每一种的速度都不一样。
这里只修改了wsad移动方式,鼠标移动的速度未进行改变
有兴趣进行修改的可以analyze一下这个函数:private void calcMoveSpeed(out float moveSpeed, out float thresholdSpeed)
找到private bool MoveCharaMouse(BlgCharController player),在这附近都是移动方法,可以由此修改移动速度
其二,不平衡Mod,移动加速&赚钱速度x10
// StatusData
public void AddMoney(int money, Action<object> cbFunc = null, object param = null, bool isPlaySe = true)
要注意的是,加钱减钱用的都是这个函数,因此需要进行判断,如果money<0则不作修改
大约就是,在程序开始的位置加入以下7行内容
ldarg.1
ldc.i4.0
ble.s ->(7) ldarg.0(这里需要选择operand type为Instruction)
ldarg.1
ldc.i4.s 10(这里需要选择operand type为SByte)
mul
starg.s ->(0)money(这里需要选择operand type为参数(para……))
版本3,+无限体力
// StatusData
public void ConsumeLife(int cost)
{
    this.m_life = Mathf.Clamp(this.m_life - this.GetLifeCost(cost), 0, this.m_maxlife);
}
// StatusData
public int GetLifeCost(int cost)
{
    int[] array = new int[]
    {
        0,
        50,
        100,
        150
    };
    float num = (100f + (float)array[this.m_condition]) / 100f;
    return (int)((float)cost * num);
}
看到这个就知道该怎么改了,只要这样:
// StatusData
public int GetLifeCost(int cost)
{
    return 0;
}
未测试·迅速生长
// DBaccessor.CropInfo_accessor
public sbyte get_growth_days(int recordno, int idx)
{
   改成 return (((CROPINFO)this._table[recordno]).growth_days[idx] > 0) ? 1 : 0;
}
未测试·无水栽培,包含了还没测试的迅速生长,原理是每天进入下一个生长等级
// FieldManager
public void ApplayWeather()
其实只要把第一个if干掉就好,于是全天气(然而很奇怪,第一天不算)不需要浇水
// FieldPlantStatus
public void Reset()
这里存在一个“当回收作物时候清空降水状态”,可能导致无水栽培失败,清理之
// CropManager
private int GetGrowthLevel_fromId(int id, int days)
{
    if (days != 0)
    {
        return 6;
    }
    return 1;
}
设定生长等级,只要长了多于一天就直接变成最高级(代码是修改后的,第一次修改的时候把ldarg写成了ldloc……于是直接死了)

// CropManager
public void DailyProcess(int mapID, int row, int col, int day)
{
    FieldPlant plant = FieldManager.GetInstance().GetPlant(mapID, row, col);
    bool flag = true;
    if (plant != null && plant.GetStatus().m_cropID > 0)
    {
        if (!this.IsTree(mapID, row, col))
        {
            int num = this.GetQuality(mapID, row, col);
            if (GameTimeController.GetInstance().GetTime().GetYear() != 1 || GameTimeController.GetInstance().GetTime().GetSeason() != HMtime.Season.Spring || GameTimeController.GetInstance().GetTime().GetDate() != 1)
            {
                num += this.DailyQPBonusWatering(mapID, row, col);
                num += this.DailyQPBonusWeather(mapID, row, col);
                num += this.DailyQPBonusWeakSpecialty(mapID, row, col);
                if (GameTimeController.GetInstance().GetTime().GetDate() == 1)
                {
                    int season = (int)GameTimeController.GetInstance().GetTime().GetSeason();
                    int id = this.GetId(mapID, row, col);
                    int num2 = (int)g_db.CropInfo[id].quality_point_max[season];
                    if (num2 <= 5)
                    {
                        num += -9;
                    }
                    else if (num2 >= 11)
                    {
                        num = num;
                    }
                }
            }
            this.SetQuality(mapID, row, col, num);
            if (num <= 0 && this.GetGrowthLevel(mapID, row, col) > 0)
            {
                this.CropWithered(mapID, row, col);
            }
        }
        if (this.IsFertilizerFlag(mapID, row, col))
        {
            int fertilizerItem = this.GetFertilizerItem(mapID, row, col);
            if (fertilizerItem != 0)
            {
                ITEMINFO iTEMINFO = g_db.ItemInfo[fertilizerItem];
                if ((int)iTEMINFO.classification_type == 8)
                {
                    int result = (int)iTEMINFO.result;
                    if (result == 44)
                    {
                        this.CropWithered(mapID, row, col);
                    }
                    else
                    {
                        int num3 = (int)g_db.FertilizerItem[result].DAY;
                        day += num3;
                        if (g_db.FertilizerItem[result].WATER == 1)
                        {
                            flag = false;
                        }
                    }
                }
                else
                {
                    Assert.Message(false, "fertilizer item ? [ " + iTEMINFO.name_msgId + " ]");
                }
            }
            else
            {
                Assert.Message(false, string.Concat(new object[]
                {
                    "fertilizer item nothing [ ",
                    row,
                    " , ",
                    col,
                    " ]"
                }));
            }
        }
        bool flag2 = this.CanHarvest(mapID, row, col);
        if (this.IsGrowth(mapID, row, col, day))
        {
            this.AddDays(mapID, row, col, day);
        }
        if (!flag2 && this.CanHarvest(mapID, row, col))
        {
            this.SetHarvest(mapID, row, col);
        }
        this.SetFertilizer(mapID, row, col, false, 0);
    }
    if (flag)
    {
        this.ResetWaterlevel(mapID, row, col);
    }
}
从这里可以修改施肥和浇水的有效时间,比如一次施肥终身受益或者一次浇水受用终身什么的
就比如大约似乎可以把这个this.SetFertilizer(mapID, row, col, false, 0);清理掉
先这么多,有空再写别的

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2025-4-11 14:56 , Processed in 0.084812 second(s), 15 queries , Memcache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表