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

注册 登录

QQ登录

只需一步,快速开始

查看: 41|回复: 0
打印 上一主题 下一主题

[原创] 变异植物效果不好,自定义效果

[复制链接]

148

主题

873

帖子

3096

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
295
金元
19163
积分
3096
精华
0
注册时间
2014-11-30
跳转到指定楼层
主题
发表于 2026-8-31 19:31 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 fanvalen 于 2026-8-31 22:19 编辑



突变和原始对比结果
Database.PlantMutations
找到
this.heavyFruit = this.AddPlantMutation("heavyFruit").AttributeModifier(Db.Get().PlantAttributes.MinRadiationThreshold, 250f, false).AttributeModifier(Db.Get().PlantAttributes.FertilizerUsageMod, 0.25f, true)
                .ForceSelfHarvestOnGrown()
                .VisualSymbolTint("swap_crop01", -0.1f, -0.5f, -0.5f)
                .VisualSymbolTint("swap_crop02", -0.1f, -0.5f, -0.5f);
改成
this.heavyFruit = this.AddPlantMutation("heavyFruit")
.AttributeModifier(Db.Get().PlantAttributes.WiltTempRangeMod, 1f, true)//温度范围+100%
.AttributeModifier(Db.Get().PlantAttributes.FertilizerUsageMod, -0.8f, true)//养料-80%
.AttributeModifier(Db.Get().PlantAttributes.YieldAmount, 1f, true)//产量+100%
.AttributeModifier(Db.Get().Amounts.Maturity.maxAttribute, -0.5f, true)//生长周期-50%(-1-0范围)
.AttributeModifier(Db.Get().BuildingAttributes.Decor, 100f, false)//装饰+100
.AttributeModifier(Db.Get().PlantAttributes.MinLightLux,200f, false)//光照需求200Lux(改成0就是不需要)
.AttributeModifier(Db.Get().PlantAttributes.MinRadiationThreshold, 250f, false)//辐射需求250(改成0就是不需要)
.BonusCrop(RotPileConfig.ID, 4f)//4kg腐烂物
.BonusCrop("BasicPlantFood", 1f)//米虱+1份

.ForceSelfHarvestOnGrown()//自动掉落
.VisualSymbolTint("swap_crop01", -0.1f, -0.5f, -0.5f)//指定位置rgb颜色
.VisualSymbolTint("swap_crop02", -0.1f, -0.5f, -0.5f);


好了现在自定义成功,但是变异还有很多渣渣词条,如何让其只变异成硕果
MutantPlant.Mutate
list.Add(Db.Get().PlantMutations.GetRandomMutation(this.PrefabID().Name).Id);

list.Add(Db.Get().PlantMutations.heavyFruit.Id);

改完散了散了




























































































































































































这个变异效果只能眼冒星星用,本体没有变异
那完了没事了

ModifierSet.CreateCritteEffects
在末尾加上
Effect effect26 = new Effect("FastMaturity", "植物生长素", "生长", 1200f, true, true, false, null, -1f, 0f, null, "");
        effect26.Add(new AttributeModifier(Db.Get().PlantAttributes.WiltTempRangeMod.Id, 1f, "温度范围+1倍", true, false, true));
        effect26.Add(new AttributeModifier(Db.Get().Amounts.Maturity.maxAttribute.Id, -0.9f, "生长时间少90%", true, false, true));
        effect26.Add(new AttributeModifier(Db.Get().Amounts.OldAge.maxAttribute.Id, -0.9999f, "自动掉落", true, false, true));
        effect26.Add(new AttributeModifier(Db.Get().Amounts.Maturity2.maxAttribute.Id, -0.9f, "果实生长少90%", true, false, true));
        this.effects.Add(effect26);



Uprootable中protected override void OnCleanUp()的上一行编辑类添加下面方法
public void OnAddEffec()
    {
        base.GetComponent<Effects>().Add("FastMaturity", false);}
Uprootable.OnRefreshUserMenu末尾增加
KIconButtonMenu.ButtonInfo buttonInfo2 = new KIconButtonMenu.ButtonInfo("ui_icon_attribute", "植物加buff", new global::System.Action(this.OnAddEffec), global::Action.NumActions, null, null, null, "变异植物现在可以收获掉落种子了", true);
            Game.Instance.userMenu.AddButton(base.gameObject, buttonInfo2, 0.1f);











回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-9-1 13:11 , Processed in 0.027997 second(s), 18 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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