public override bool ReApply(Terraria.Player player, int time, int buffIndex) { if (player.GetModPlayer <HordePlayer>().HordeStacks < 2) { player.GetModPlayer <HordePlayer>().HordeStacks++; Main.NewText("Super-Charged Horde Effect!", Color.BlueViolet); } player.buffTime[buffIndex] = 36000; return(true); }
public override void Update(Player player, ref int buffIndex) { player.GetModPlayer<ExamplePlayer>(mod).exampleLightPet = true; player.buffTime[buffIndex] = 18000; bool petProjectileNotSpawned = player.ownedProjectileCounts[mod.ProjectileType("ExampleLightPet")] <= 0; if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("ExampleLightPet"), 0, 0f, player.whoAmI, 0f, 0f); } if ((player.controlDown && player.releaseDown)) { if (player.doubleTapCardinalTimer[0] > 0 && player.doubleTapCardinalTimer[0] != 15) { for (int j = 0; j < 1000; j++) { if (Main.projectile[j].active && Main.projectile[j].type == mod.ProjectileType("ExampleLightPet") && Main.projectile[j].owner == player.whoAmI) { Projectile lightpet = Main.projectile[j]; Vector2 vectorToMouse = Main.MouseWorld - lightpet.Center; lightpet.velocity += 5f * Vector2.Normalize(vectorToMouse); } } } } }
internal static void ReadCustomData(Player player, BinaryReader reader) { int count = reader.ReadUInt16(); for (int k = 0; k < count; k++) { string modName = reader.ReadString(); string name = reader.ReadString(); byte[] data = reader.ReadBytes(reader.ReadUInt16()); Mod mod = ModLoader.GetMod(modName); ModPlayer modPlayer = mod == null ? null : player.GetModPlayer(mod, name); if (modPlayer != null) { using (MemoryStream stream = new MemoryStream(data)) { using (BinaryReader customReader = new BinaryReader(stream)) { modPlayer.LoadCustomData(customReader); } } if (modName == "ModLoader" && name == "MysteryPlayer") { ((MysteryPlayer)modPlayer).RestoreData(player); } } else { ModPlayer mystery = player.GetModPlayer(ModLoader.GetMod("ModLoader"), "MysteryPlayer"); ((MysteryPlayer)mystery).AddData(modName, name, data); } } }
public override void UpdateAccessory(Player player, bool hideVisual) { GyrolitePlayer gp = (GyrolitePlayer)player.GetModPlayer(mod, "GyrolitePlayer"); gp.ringType = 1; gp.ringEffects[0] = item.shoot; gp.ringEffects[1] = BuffID.CursedInferno; }
public override bool UseItem(Player player) { GyrolitePlayer gp = player.GetModPlayer<GyrolitePlayer>(mod); player.statLifeMax += 50; gp.lunarHeartStack++; return true; }
public override void EditSpawnRate(Player player, ref int spawnRate, ref int maxSpawns) { if (player.GetModPlayer<ExamplePlayer>(mod).ZoneExample) { spawnRate = (int)(spawnRate * 5f); maxSpawns = (int)(maxSpawns * 5f); } }
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { if (target.hurtCooldowns[1] <= 0) { ExamplePlayer modPlayer = target.GetModPlayer<ExamplePlayer>(mod); modPlayer.constantDamage = projectile.damage; modPlayer.percentDamage = Main.expertMode ? 0.6f : 0.5f; } }
public override bool CanUseItem(Player player) { GyrolitePlayer gp = player.GetModPlayer<GyrolitePlayer>(mod); if (gp.lunarHeartStack < 2) { return true; } return false; }
public override void Update(Player player, ref int buffIndex) { player.buffTime[buffIndex] = 18000; player.GetModPlayer<ExamplePlayer>(mod).examplePet = true; bool petProjectileNotSpawned = player.ownedProjectileCounts[mod.ProjectileType("ExamplePet")] <= 0; if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("ExamplePet"), 0, 0f, player.whoAmI, 0f, 0f); } }
public override void Update(Player player, ref int buffIndex) { player.buffTime[buffIndex] = 18000; ((GyrolitePlayer)player.GetModPlayer(mod, "GyrolitePlayer")).dwarfFeederPet = true; bool petProjectileNotSpawned = player.ownedProjectileCounts[mod.ProjectileType("DwarfFeederHead")] <= 0; if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { Projectile.NewProjectile(Main.MouseWorld.X, Main.MouseWorld.Y, 0f, 0f, mod.ProjectileType("DwarfFeederHead"), 0, 0f, player.whoAmI, 0f, 0f); } }
public override void UpdateArmorSet(Player player) { GyrolitePlayer p = player.GetModPlayer<GyrolitePlayer>(mod); p.frostbiteMax += 900; player.magicDamage += 0.08F; player.meleeDamage += 0.08F; player.rangedDamage += 0.08F; player.minionDamage += 0.08F; player.thrownDamage += 0.08F; }
public override bool Shoot(Terraria.Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.GetModPlayer <bl3Player>().chargeTime == 0) { type = ProjectileID.None; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/krakatoaCharge"); } else if (player.GetModPlayer <bl3Player>().chargeTime > 100) { type = mod.ProjectileType("krakatoaProj"); item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/krakatoa"); } else { type = ProjectileID.None; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/none"); Dust dust; dust = Main.dust[Terraria.Dust.NewDust(item.position, 0, 45, 132, 0f, 0f, 0, new Color(255, 255, 255), 4)]; dust.noGravity = true; } return(true); }
public override void Update(Player player, ref int buffIndex) { SPlayer sPlayer = player.GetModPlayer<SPlayer>(mod); if (player.ownedProjectileCounts[mod.ProjectileType("UnboundSoul")] > 0) { sPlayer.unboundSoulMinion = true; } if (!sPlayer.unboundSoulMinion) { player.DelBuff(buffIndex); buffIndex--; return; } player.buffTime[buffIndex] = 18000; }
public override void Update(Player player, ref int buffIndex) { GyrolitePlayer gp = (GyrolitePlayer)player.GetModPlayer(mod, "GyrolitePlayer"); if (player.ownedProjectileCounts[mod.ProjectileType("VileGeyserMinion")] > 0) { gp.vileGeyserMinion = true; } if (!gp.vileGeyserMinion) { player.DelBuff(buffIndex); buffIndex--; } else { player.buffTime[buffIndex] = 18000; } }
public override void Update(Player player, ref int buffIndex) { ExamplePlayer modPlayer = player.GetModPlayer<ExamplePlayer>(mod); if (player.ownedProjectileCounts[mod.ProjectileType("PurityWisp")] > 0) { modPlayer.purityMinion = true; } if (!modPlayer.purityMinion) { player.DelBuff(buffIndex); buffIndex--; } else { player.buffTime[buffIndex] = 18000; } }
public override void Update(Player player, ref int buffIndex) { EnergyPlayer modPlayer = (EnergyPlayer)player.GetModPlayer(mod, "EnergyPlayer"); if (player.ownedProjectileCounts[mod.ProjectileType("TreeMinion")] > 0) { modPlayer.treeMinion = true; } if (!modPlayer.treeMinion) { player.DelBuff(buffIndex); buffIndex--; } else { player.buffTime[buffIndex] = 18000; } }
public override bool UseItem(Item item, Player player) { if (item.healLife > 0) { if (player.GetModPlayer<ExamplePlayer>(mod).badHeal) { int heal = item.healLife; int damage = player.statLifeMax2 - player.statLife; if (heal > damage) { heal = damage; } if (heal > 0) { player.AddBuff(mod.BuffType("Undead2"), 2 * heal, false); } } } return base.UseItem(item, player); }
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { if (target.hurtCooldowns[1] <= 0) { ExamplePlayer modPlayer = (ExamplePlayer)target.GetModPlayer(mod, "ExamplePlayer"); modPlayer.constantDamage = projectile.damage; modPlayer.percentDamage = Main.expertMode ? 1.2f : 1f; } }
public override void UpdateEffects(Player player) { SPlayer sPlayer = (SPlayer)player.GetModPlayer(mod, "SPlayer"); sPlayer.drakomireMount = true; }
public override void Update(Player player, ref int buffIndex) { player.GetModPlayer<MyPlayer>(mod).DoomDestiny = true; }
public override void UpdateAccessory(Player player, bool hideVisual) { ((EnergyPlayer)player.GetModPlayer(mod, "EnergyPlayer")).firestorm = true; player.jumpSpeedBoost = 2f; }
public override void UpdateAccessory(Player player, bool hideVisual) { SPlayer sPlayer = (SPlayer)player.GetModPlayer(mod, "SPlayer"); sPlayer.goldenApple = true; }
public override void UpdateAccessory(Player player) { ((ExamplePlayer)player.GetModPlayer(mod, "ExamplePlayer")).elementShield = true; }
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { if (target.hurtCooldowns[1] <= 0) { ExamplePlayer modPlayer = target.GetModPlayer<ExamplePlayer>(mod); modPlayer.defenseEffect = 1f; } }
public override void UpdateEffects(Player player) { GyrolitePlayer modPlayer = (GyrolitePlayer)player.GetModPlayer(mod, "GyrolitePlayer"); modPlayer.wyvernMount = true; }
public override void UpdateAccessory(Player player, bool hideVisual) { player.GetModPlayer<ExamplePlayer>(mod).elementShield = true; }
public override void UpdateAccessory(Player player, bool hideVisual) { player.GetModPlayer<MyPlayer>(mod).SRingOn = true; }
public override void Update(Player player, ref int buffIndex) { player.GetModPlayer<ExamplePlayer>(mod).eFlames = true; }
public override void UpdateAccessory(Player player, bool hideVisual) { ((EnergyPlayer)player.GetModPlayer(mod, "EnergyPlayer")).lifesteal = true; }
public override void Update(Player player, ref int buffIndex) { int extra = player.buffTime[buffIndex] / 60; player.buffTime[buffIndex] -= extra; ((ExamplePlayer)player.GetModPlayer(mod, "ExamplePlayer")).healHurt = extra + 1; }
public static GyrolitePlayer GetPlayer(Player player) { return (GyrolitePlayer)player.GetModPlayer(ModLoader.GetMod("Gyrolite"), "GyrolitePlayer"); }
public override void UpdateEquip(Player player) { player.GetModPlayer<MyPlayer>(mod).hpRegenRing = true; }