= 创作分享 =
你问我答
请教 [GF]少女前线MOD,如何修改生物攻击目标和寄生虫转 ...
Nayokutori

请教 [GF]少女前线MOD,如何修改生物攻击目标和寄生虫转化

Nayokutori 于 2022-9-24 11:39 ( 1年前 ) [复制链接] [只看楼主] [打印]
738 3
50RF
[GF] 少女前线 Girls' Frontline / ドールズフロントライン/ HMGDollsFrontLine

这个MOD中的敌对生物不会主动攻击带着金头盔的玩家,这一点也不cool
MOD版本是 1.12.2.β.21.1 config目录下的配置文件没有关于目标的设置
在多mod整合包下游玩时,想要设置铁血和其他生物对抗时十分不方便
(其实就是对抗寄生虫,即便在寄生虫配置文件里面写入模组界面展示的modID:hmggirlfront,
mod内的铁血生物也不会去主动攻击寄生虫,寄群之唤依旧能转换mod内的生物)
(机器人什么的还有载具被转换成同化感染血肉实在是太违和了)
模组界面下的mod信息




发表于 2022-9-24 11:39:56 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

回复 | 举报

该帖共收到 3 条回复!
Nayokutori
下面是废好大劲用IntelliJ IDEA查看的 HMGDollsFrontLine1.12.2.β.21.1.zip\hmggirlfront\entity\mob\ai\IBCAI_Entity.class内的内容

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package hmggirlfront.entity.mob.ai;

import gvclib.entity.EntityP_Particle;
import gvclib.entity.living.EntityGVCLivingBase;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.IMob;
import net.minecraft.init.MobEffects;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;

public class IBCAI_Entity {
    public IBCAI_Entity() {
    }

    public static void getTargetEntity(EntityGVCLivingBase entity, double range, double range_active, double maxy, double miny, double notifyrange) {
        if (!entity.field_70170_p.field_72995_K) {
            if (entity.find_enemy_count > 0) {
                --entity.find_enemy_count;
            }

            double k = entity.field_70165_t;
            double l = entity.field_70163_u;
            double i = entity.field_70161_v;
            if (entity.targetentity == null) {
                double var10000;
                AxisAlignedBB axisalignedbb;
                List llist;
                int lj;
                Entity entity1;
                boolean ridding_nottarget;
                EntityGVCLivingBase vehicle;
                double d5;
                double d7;
                double d1;
                double d3;
                float f11;
                float rotep_offset;
                boolean flag;
                if (entity.getMobMode() == 0) {
                    axisalignedbb = (new AxisAlignedBB(k - range, l - miny, i - range, k + range, l + maxy, i + range)).func_186662_g(1.0);
                    llist = entity.field_70170_p.func_72839_b(entity, axisalignedbb);
                    if (llist != null) {
                        for(lj = 0; lj < llist.size(); ++lj) {
                            entity1 = (Entity)llist.get(lj);
                            if (entity1.func_70067_L() && entity.CanAttack(entity1) && entity1 != null && ((EntityLivingBase)entity1).func_110143_aJ() > 0.0F && entity.func_110143_aJ() > 0.0F) {
                                ridding_nottarget = true;
                                if (entity1.func_184187_bx() instanceof EntityGVCLivingBase && entity1.func_184187_bx() != null) {
                                    vehicle = (EntityGVCLivingBase)entity1.func_184187_bx();
                                    if (vehicle.ridding_nottarget) {
                                        ridding_nottarget = false;
                                    }
                                }

                                if (ridding_nottarget) {
                                    flag = entity.func_70635_at().func_75522_a(entity1);
                                    if (flag) {
                                        d5 = entity1.field_70165_t - entity.field_70165_t;
                                        d7 = entity1.field_70161_v - entity.field_70161_v;
                                        var10000 = entity1.field_70163_u - entity.field_70163_u;
                                        d1 = entity.field_70163_u - entity1.field_70163_u;
                                        d3 = (double)MathHelper.func_76133_a(d5 * d5 + d7 * d7);
                                        f11 = (float)(-(Math.atan2(d1, d3) * 180.0 / Math.PI));
                                        rotep_offset = -f11 + entity.angle_offset;
                                        if (rotep_offset <= entity.rotationp_min && rotep_offset >= entity.rotationp_max) {
                                            entity.find_enemy_count += 2;
                                            double ddx = Math.abs(d5);
                                            double ddz = Math.abs(d7);
                                            if (ddx < 5.0 && ddz < 5.0) {
                                                entity.find_enemy_count += 20;
                                            } else if (ddx < 15.0 && ddz < 15.0) {
                                                entity.find_enemy_count += 10;
                                            } else if (ddx < 25.0 && ddz < 25.0) {
                                                entity.find_enemy_count += 5;
                                            }

                                            EntityP_Particle particle;
                                            if (!entity.field_70170_p.field_72995_K && entity.find_enemy_count % 10 == 0) {
                                                particle = new EntityP_Particle(entity.field_70170_p);
                                                particle.func_70012_b(entity.field_70165_t, entity.field_70163_u + (double)entity.field_70131_O + 1.0, entity.field_70161_v, entity.field_70177_z, 0.0F);
                                                particle.setModel("hmggirlfront:textures/particle/find.mqo");
                                                particle.setTex("hmggirlfront:textures/particle/find.png");
                                                particle.startposX = entity.field_70165_t;
                                                particle.startposY = entity.field_70163_u + (double)entity.field_70131_O + 1.0;
                                                particle.startposZ = entity.field_70161_v;
                                                particle.timemax = 20;
                                                entity.field_70170_p.func_72838_d(particle);
                                            }

                                            entity.field_70759_as = entity.rotation = entity.rote = entity.field_70761_aq = -((float)Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
                                            entity.rotationp = entity.field_70125_A = -f11 + entity.angle_offset;
                                            if (entity.find_enemy_count > entity.find_enemy_maxcount && !((EntityLivingBase)entity1).func_70644_a(MobEffects.field_76441_p)) {
                                                entity.targetentity = (EntityLivingBase)entity1;
                                                entity.setMobMode(1);
                                                entity.sneak = true;
                                                if (!entity.field_70170_p.field_72995_K) {
                                                    particle = new EntityP_Particle(entity.field_70170_p);
                                                    particle.func_70012_b(entity.field_70165_t, entity.field_70163_u + (double)entity.field_70131_O + 1.0, entity.field_70161_v, entity.field_70177_z, 0.0F);
                                                    particle.setModel("hmggirlfront:textures/particle/search.mqo");
                                                    particle.setTex("hmggirlfront:textures/particle/search.png");
                                                    particle.startposX = entity.field_70165_t;
                                                    particle.startposY = entity.field_70163_u + (double)entity.field_70131_O + 1.0;
                                                    particle.startposZ = entity.field_70161_v;
                                                    particle.timemax = 20;
                                                    entity.field_70170_p.func_72838_d(particle);
                                                }

                                                notifyEntity(entity, notifyrange, (EntityLivingBase)entity1, true);
                                                if (!entity.getattacktask()) {
                                                    entity.setattacktask(true);
                                                }
                                            }
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    if (entity.biped && entity.func_70644_a(MobEffects.field_76440_q)) {
                        entity.targetentity = null;
                        entity.setMobMode(1);
                        entity.sneak = false;
                        entity.setattacktask(false);
                    }
                } else {
                    axisalignedbb = (new AxisAlignedBB(k - range_active, l - miny, i - range_active, k + range_active, l + maxy, i + range_active)).func_186662_g(1.0);
                    llist = entity.field_70170_p.func_72839_b(entity, axisalignedbb);
                    if (llist != null) {
                        for(lj = 0; lj < llist.size(); ++lj) {
                            entity1 = (Entity)llist.get(lj);
                            if (entity1.func_70067_L() && entity.CanAttack(entity1) && entity1 != null && ((EntityLivingBase)entity1).func_110143_aJ() > 0.0F && entity.func_110143_aJ() > 0.0F) {
                                ridding_nottarget = true;
                                if (entity1.func_184187_bx() instanceof EntityGVCLivingBase && entity1.func_184187_bx() != null) {
                                    vehicle = (EntityGVCLivingBase)entity1.func_184187_bx();
                                    if (vehicle.ridding_nottarget) {
                                        ridding_nottarget = false;
                                    }
                                }

                                if (ridding_nottarget) {
                                    flag = entity.func_70635_at().func_75522_a(entity1);
                                    if (flag) {
                                        d5 = entity1.field_70165_t - entity.field_70165_t;
                                        d7 = entity1.field_70161_v - entity.field_70161_v;
                                        var10000 = entity1.field_70163_u - entity.field_70163_u;
                                        d1 = entity.field_70163_u - entity1.field_70163_u;
                                        d3 = (double)MathHelper.func_76133_a(d5 * d5 + d7 * d7);
                                        f11 = (float)(-(Math.atan2(d1, d3) * 180.0 / Math.PI));
                                        rotep_offset = -f11 + entity.angle_offset;
                                        if (rotep_offset <= entity.rotationp_min && rotep_offset >= entity.rotationp_max) {
                                            if (!((EntityLivingBase)entity1).func_70644_a(MobEffects.field_76441_p)) {
                                                entity.targetentity = (EntityLivingBase)entity1;
                                                entity.setMobMode(1);
                                                entity.sneak = true;
                                                notifyEntity(entity, notifyrange, (EntityLivingBase)entity1, true);
                                                if (!entity.field_70170_p.field_72995_K) {
                                                    EntityP_Particle particle = new EntityP_Particle(entity.field_70170_p);
                                                    particle.func_70012_b(entity.field_70165_t, entity.field_70163_u + (double)entity.field_70131_O + 1.0, entity.field_70161_v, entity.field_70177_z, 0.0F);
                                                    particle.setModel("hmggirlfront:textures/particle/search.mqo");
                                                    particle.setTex("hmggirlfront:textures/particle/search.png");
                                                    particle.startposX = entity.field_70165_t;
                                                    particle.startposY = entity.field_70163_u + (double)entity.field_70131_O + 1.0;
                                                    particle.startposZ = entity.field_70161_v;
                                                    particle.timemax = 20;
                                                    entity.field_70170_p.func_72838_d(particle);
                                                }

                                                if (!entity.getattacktask()) {
                                                    entity.setattacktask(true);
                                                }
                                            }
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    if (entity.biped && entity.func_70644_a(MobEffects.field_76440_q)) {
                        entity.targetentity = null;
                        entity.setMobMode(1);
                        entity.sneak = false;
                        entity.setattacktask(false);
                    }
                }
            }

        }
    }

    public static void notifyEntity(EntityGVCLivingBase entity, double notifyrange, EntityLivingBase target, boolean cansee) {
        double k = entity.field_70165_t;
        double l = entity.field_70163_u;
        double i = entity.field_70161_v;
        AxisAlignedBB axisalignedbb = (new AxisAlignedBB(k - notifyrange, l - notifyrange, i - notifyrange, k + notifyrange, l + notifyrange, i + notifyrange)).func_186662_g(1.0);
        List<Entity> llist = entity.field_70170_p.func_72839_b(entity, axisalignedbb);
        if (llist != null) {
            for(int lj = 0; lj < llist.size(); ++lj) {
                Entity entity1 = (Entity)llist.get(lj);
                if (entity1.func_70067_L() && entity1 instanceof IMob && entity1 != null && ((EntityLivingBase)entity1).func_110143_aJ() > 0.0F && entity.func_110143_aJ() > 0.0F && entity1 instanceof EntityGVCLivingBase) {
                    EntityGVCLivingBase mob = (EntityGVCLivingBase)entity1;
                    boolean see = entity.func_70635_at().func_75522_a(entity1);
                    boolean flag = true;
                    if (cansee && !see) {
                        flag = false;
                    }

                    if (flag && mob.targetentity == null) {
                        mob.targetentity = target;
                        mob.setMobMode(1);
                        mob.sneak = true;
                        if (!mob.field_70170_p.field_72995_K) {
                            EntityP_Particle particle = new EntityP_Particle(mob.field_70170_p);
                            particle.func_70012_b(mob.field_70165_t, mob.field_70163_u + (double)mob.field_70131_O + 1.0, mob.field_70161_v, mob.field_70177_z, 0.0F);
                            particle.setModel("hmggirlfront:textures/particle/search.mqo");
                            particle.setTex("hmggirlfront:textures/particle/search.png");
                            particle.startposX = mob.field_70165_t;
                            particle.startposY = mob.field_70163_u + (double)mob.field_70131_O + 1.0;
                            particle.startposZ = mob.field_70161_v;
                            particle.timemax = 20;
                            mob.field_70170_p.func_72838_d(particle);
                        }

                        if (!mob.getattacktask()) {
                            mob.setattacktask(true);
                        }
                    }
                    break;
                }
            }
        }

    }
}
发表于 2022-9-25 08:50:35 | 只看该作者

回复 | 举报

狗驴的蹄子
同问,不过有两个MOD可以解感染,一个是寄生虫的疫苗(vaccine)还一个是HBM的解毒剂
发表于 2022-11-3 23:14:37 | 只看该作者

回复 | 举报

狗驴的蹄子
做不到的(摇手指),用战斗发令器也无法达成个体间的战斗
发表于 2023-1-14 14:42:12 | 只看该作者

回复 | 举报

百科目前不允许匿名发帖哦~ 请先 [ 登陆 ][ 注册 ] 吧~

本版积分规则

发新帖
  • 回复
  • 点评
  • 评分

[ MC百科(mcmod.cn) 除另有声明,所有开放公共编辑的内容均使用 BY-NC-SA 3.0 协议 ]

Minecraft百科CC协议
快速回复 返回顶部 返回列表