예제 #1
0
    public override uint UpdateW(int arg1, VigObject arg2)
    {
        short        sVar1;
        uint         uVar2;
        int          iVar3;
        RiftBlade2   puVar4;
        VigTransform puVar5;
        short        sVar6;
        Vector3Int   local_18;

        switch (arg1)
        {
        case 0:
            FUN_42330(arg2);
            uVar2 = 0;
            break;

        case 1:
            type          = 3;
            maxHalfHealth = 3;
            flags        |= 0x4000;
            goto default;

        default:
            uVar2 = 0;
            break;

        case 12:
            if (DAT_19 == 0)
            {
                puVar4 = arg2.vData.ini.FUN_2C17C(2, typeof(RiftBlade2), 8) as RiftBlade2;

                if (puVar4 == null)
                {
                    return(0);    //FUN_15D9C
                }
                else
                {
                    Utilities.ParentChildren(puVar4, puVar4);
                    DAT_19            = 0;
                    puVar4.flags      = 0x20000000;
                    sVar1             = arg2.id;
                    puVar4.type       = 8;
                    puVar4.DAT_80     = arg2;
                    puVar4.id         = sVar1;
                    puVar5            = GameManager.instance.FUN_2CDF4(arg2);
                    puVar4.DAT_84_2   = puVar5;
                    puVar4.vTransform = arg2.vTransform;
                    puVar4.DAT_AC     = 0x199;
                    puVar4.DAT_B0     = 0x1000;
                    puVar4.FUN_305FC();
                    puVar4.FUN_30B78();
                    puVar4.FUN_30BF0();
                    arg2.FUN_30BA8();
                    arg2.physics1.W = 0;
                    arg2.physics1.X = 0;
                    arg2.flags     |= 0x6000020;
                    arg2.physics1.Y = 0;
                    arg2.physics1.Z = 0;
                    arg2.physics2.X = 0;
                    arg2.physics2.Y = 0;
                    arg2.physics2.Z = 0;
                    GameManager.instance.FUN_30CB0(puVar4, 29);
                    puVar4.screen              = vTransform.position;
                    puVar4.screen.x            = -vTransform.position.x >> 12;
                    puVar4.screen.y            = -vTransform.position.y >> 12;
                    puVar4.screen.z            = -vTransform.position.z >> 12;
                    puVar4.DAT_B4              = 0;
                    puVar4.vTransform.position = Utilities.FUN_24148(puVar4.vTransform, vTransform.position);
                    iVar3 = GameManager.instance.FUN_1DD9C();
                    GameManager.instance.FUN_1E580(iVar3, arg2.vData.sndList, 4, puVar4.vTransform.position);
                    iVar3 = GameManager.instance.FUN_1DD9C();
                    GameManager.instance.FUN_1E188(iVar3, vData.sndList, 2);
                    GameManager.instance.DAT_1084++;
                    sVar6         = (short)(maxHalfHealth - 1);
                    maxHalfHealth = (ushort)sVar6;

                    if (sVar6 == 0)
                    {
                        FUN_3A368();
                        return(240);
                    }
                }

                uVar2 = 240;
            }
            else
            {
                //iVar3 = GameManager.instance.FUN_1DD9C();
                //GameManager.instance.FUN_1E14C(iVar3, GameManager.instance.DAT_C2C, 1);
                //uVar2 = 240;
                return(0);
            }

            break;

        case 13:
            uVar2 = 0;

            if (GameManager.instance.DAT_1084 == 0)
            {
                local_18 = Utilities.FUN_24304(arg2.vTransform, ((Vehicle)arg2).target.vTransform.position);
                uVar2    = 0;

                if ((uint)local_18.z - 0x19001 < 0x63fff)
                {
                    if (local_18.x < 0)
                    {
                        local_18.x = -local_18.x;
                    }

                    uVar2 = local_18.x * 6 - 0x10000 < local_18.z ? 1U : 0;
                }
            }

            break;
        }

        return(uVar2);
    }
예제 #2
0
    public override uint UpdateW(int arg1, VigObject arg2)
    {
        int          iVar3;
        HellGate2    ppcVar4;
        VigObject    pcVar5;
        XOBF_DB      dbVar5;
        int          iVar7;
        VigObject    oVar7;
        VigTransform tVar7;
        Vector3Int   auStack24;

        switch (arg1)
        {
        case 1:
            FUN_30B78();
            maxHalfHealth = 3;
            flags        |= 0x4000;
            break;

        case 12:
            pcVar5 = ((Vehicle)arg2).target;

            if ((pcVar5 == null && (pcVar5 = arg2) == null) ||
                (flags & 0x1000000) != 0 || (arg2.flags & 0x30000000) != 0x30000000 ||
                pcVar5.vTransform.position.x < VigTerrain.instance.DAT_DE4 ||
                VigTerrain.instance.DAT_DF0 < pcVar5.vTransform.position.x ||
                pcVar5.vTransform.position.z < VigTerrain.instance.DAT_DEC ||
                VigTerrain.instance.DAT_DF0 < pcVar5.vTransform.position.z ||
                VigTerrain.instance.GetTileByPosition
                    ((uint)pcVar5.vTransform.position.x, (uint)pcVar5.vTransform.position.z).DAT_10[3] == 7)
            {
                //iVar3 = GameManager.instance.FUN_1DD9C();
                //GameManager.instance.FUN_1E14C(iVar3, GameManager.instance.DAT_C2C, 1);
                return(0);
            }
            else
            {
                if (arg2.id < 0)
                {
                    GameManager.instance.FUN_15B00(~arg2.id, 128, 64, 64);
                }

                if (maxHalfHealth < 4)
                {
                    PDAT_74 = PDAT_74.PDAT_74;
                    GameManager.instance.FUN_309A0(PDAT_74);
                }

                iVar3 = GameManager.instance.FUN_1DD9C();
                GameManager.instance.FUN_1E580(iVar3, vData.sndList, 4, arg2.vTransform.position);
                iVar3 = GameManager.instance.FUN_1DD9C();
                GameManager.instance.FUN_1E188(iVar3, vData.sndList, 2);
                tVar7     = GameManager.instance.FUN_2CDF4(this);
                auStack24 = GameManager.instance.terrain.FUN_1B998((uint)tVar7.position.x, (uint)tVar7.position.z);
                auStack24 = Utilities.VectorNormal(auStack24);
                GameObject obj = new GameObject();
                ppcVar4        = obj.AddComponent <HellGate2>();
                ppcVar4.flags  = 0xa4;
                dbVar5         = vData;
                ppcVar4.DAT_80 = arg2;
                ppcVar4.DAT_94 = this;
                ppcVar4.vData  = dbVar5;

                if (pcVar5 == null)
                {
                    pcVar5 = arg2;
                }

                ppcVar4.DAT_84 = pcVar5;
                ppcVar4.vTransform.rotation = Utilities.FUN_2A5EC(auStack24);
                ppcVar4.vTransform.position = tVar7.position;
                ppcVar4.FUN_305FC();

                if (ppcVar4.GetType().IsSubclassOf(typeof(VigObject)))
                {
                    ppcVar4.UpdateW(2, 0);
                }

                arg2.FUN_30BA8();
                arg2.flags |= 0x6000020;
                GameManager.instance.DAT_1084++;
                maxHalfHealth--;
            }

            if (-1 < arg2.id)
            {
                return(900);
            }

            return(480);

        case 13:
            if (GameManager.instance.DAT_1084 != 0)
            {
                return(0);
            }

            if ((flags & 0x1000000) != 0)
            {
                return(0);
            }

            oVar7 = ((Vehicle)arg2).target;

            if ((arg2.flags & oVar7.flags & 0x30000000) != 0x30000000)
            {
                return(0);
            }

            if (1524 < oVar7.physics1.W)
            {
                return(0);
            }

            iVar7 = Utilities.FUN_29F6C(arg2.screen, oVar7.screen);
            return(0x64000 < iVar7 ? 1U : 0);

        case 16:
            oVar7        = arg2.PDAT_74;
            arg2.PDAT_74 = oVar7.PDAT_74;

            if (2 < maxHalfHealth)
            {
                GameManager.instance.FUN_309A0(oVar7);
                return(0);
            }

            oVar7.PDAT_74         = PDAT_74;
            PDAT_74               = oVar7;
            ((Demon)oVar7).DAT_94 = this;
            break;
        }

        return(0);
    }