mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-11 21:56:54 +00:00
arcane missle initial logic
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Items.ArcaneMissle;
|
||||
|
||||
public class ArcaneMissleBehavior : GlobalNPC {
|
||||
|
||||
public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit) {
|
||||
if (!crit) {
|
||||
base.OnHitByProjectile(npc, projectile, damage, knockback, false);
|
||||
return;
|
||||
}
|
||||
Player player = Main.LocalPlayer;
|
||||
|
||||
if (player.GetModPlayer<YhtPlayer>().arcaneMissle && projectile.DamageType == DamageClass.Magic) {
|
||||
// player just crit with magic weapon while having arcane missle accessory equipped
|
||||
}
|
||||
|
||||
base.OnHitByProjectile(npc, projectile, damage, knockback, true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user