public static CanHitNPC ( Item item, |
||
item | Item | |
player | ||
target | Terraria.NPC | |
Результат | bool? |
public static bool?CanPlayerHitNPCWithItem(Player player, Item item, NPC npc) { bool?result = null; bool ModifyResult(bool?nbool) { if (nbool.HasValue) { result = nbool.Value; } return(result != false); } if (!ModifyResult(PlayerHooks.CanHitNPC(player, item, npc))) { return(false); } if (!ModifyResult(ItemLoader.CanHitNPC(item, player, npc))) { return(false); } if (!ModifyResult(NPCLoader.CanBeHitByItem(npc, player, item))) { return(false); } return(result); }