public void AddTikiSource(Projectile projectile) { TikiSources[TikiSlot] = new TikiData(projectile); TikiSlot++; if (TikiSlot >= Buffs.TikiInfestation.maxStacks) { TikiSlot = 0; } if (TikiStacks < Buffs.TikiInfestation.maxStacks) { TikiStacks++; } }
public override bool PreNPCLoot(NPC npc) { NInfo data = npc.GetModInfo <NInfo>(mod); if (npc.FindBuffIndex(Buffs.TikiInfestation._ref.Type) >= 0) { Vector2 pos = npc.Center; for (int i = data.TikiStacks - 1; i >= 0; i--) { //Spawn Tiki Spirits TikiData source = data.TikiSources[i]; Projectile.NewProjectile(pos.X, pos.Y, 0f, 0f, Projectiles.Arrow.TikiBiter._ref.projectile.type, source.wasSpirit ? source.damage : (int)(source.damage * 0.75f), 0f, source.owner, -1f); } } return(true); }