Exemple #1
0
        //ugh this name
        private int Projectile_NewProjectile(On.Terraria.Projectile.orig_NewProjectile_float_float_float_float_int_int_float_int_float_float orig, float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float KnockBack, int Owner, float ai0, float ai1)
        {
            int        index      = orig(X, Y, SpeedX, SpeedY, Type, Damage, KnockBack, Owner, ai0, ai1);
            Projectile projectile = Main.projectile[index];

            TrailManager.DoTrailCreation(projectile);

            return(index);
        }
        private static int Projectile_NewProjectile(On.Terraria.Projectile.orig_NewProjectile_float_float_float_float_int_int_float_int_float_float orig, float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float KnockBack, int Owner, float ai0, float ai1)
        {
            int        index      = orig(X, Y, SpeedX, SpeedY, Type, Damage, KnockBack, Owner, ai0, ai1);
            Projectile projectile = Main.projectile[index];

            if (Main.netMode != NetmodeID.Server)
            {
                SpiritMod.TrailManager.DoTrailCreation(projectile);
            }

            return(index);
        }
Exemple #3
0
        private static int On_Terraria_Projectile_NewProjectile(
            On.Terraria.Projectile.orig_NewProjectile_float_float_float_float_int_int_float_int_float_float orig,
            float x, float y, float speedX, float speedY, int type, int damage, float knockBack, int owner, float ai0, float ai1)
        {
            int index = orig(x, y, speedX, speedY, type, damage, knockBack, owner, ai0, ai1);

            var proj = Main.projectile[index];

            if (proj?.modProjectile is Content.OrchidProjectile orchidProj)
            {
                orchidProj.OnSpawn();
            }

            return(index);
        }
Exemple #4
0
        public static int NewProjHook(On.Terraria.Projectile.orig_NewProjectile_float_float_float_float_int_int_float_int_float_float orig, float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float KnockBack, int Owner = 255, float ai0 = 0f, float ai1 = 0f)
        {
            int wmi = orig.Invoke(X, Y, SpeedX, SpeedY, Type, Damage, KnockBack, Owner, ai0, ai1);

            if (wmi != -1)
            {
                if (NewXXXState == "NPC")
                {
                    Main.projectile[wmi].GetGlobalProjectile <ProjectileOwnerGProj>().OwnerWMI = GetSource(Main.npc[NewXXXSource]);
                }
                else if (NewXXXState == "Projectile")
                {
                    Main.projectile[wmi].GetGlobalProjectile <ProjectileOwnerGProj>().OwnerWMI = Main.projectile[NewXXXSource].GetGlobalProjectile <ProjectileOwnerGProj>().OwnerWMI;// Main.projectile[NewXXXSource].GetGlobalProjectile<ProjectileOwnerGProj>().OwnerWMI;
                }
            }
            return(wmi);
        }