public override void DamageCollision(DamageColliderInfo info, PlayerCharacter receiver) { if (info.colliderName.Equals("Bite")) { biteCollider.enabled = false; } }
public static void OnNPCAttack(DamageColliderInfo info, NPC attacker, PlayerCharacter player) { if (!attacker.DisableMultipleCollision(info, player)) { DoDamage(attacker, player, info); } }
public override bool DisableMultipleCollision(DamageColliderInfo info, PlayerCharacter receiver) { if (info.colliderName.Equals("Tail") && disableMultipleCollisition[DragonNPCAbility.TAIL_ATTACK].Contains(receiver)) { return(true); } else if (info.colliderName.Equals("Tail") && !disableMultipleCollisition[DragonNPCAbility.TAIL_ATTACK].Contains(receiver)) { disableMultipleCollisition[DragonNPCAbility.TAIL_ATTACK].Add(receiver); } return(false); }
public override float AbilityDamage(DamageColliderInfo info) { if (info.colliderName.Equals("Bite")) { return(abilities[DragonNPCAbility.BITE].multiplier); } else if (info.colliderName.Equals("Tail")) { return(abilities[DragonNPCAbility.TAIL_ATTACK].multiplier); } return(0); }
private static void DoDamage(NPC attacker, PlayerCharacter receiver, DamageColliderInfo info) { if (receiver.data.dead) { return; } bool crit; float damage; CalcDamage(receiver.defence, attacker, attacker.AbilityDamage(info), out crit, out damage); receiver.TakeDamage(damage, crit); attacker.DamageCollision(info, receiver); }
private void OnTriggerEnter(Collider other) { if (other.name.Equals("Sphere")) { int otherPlayerId = other.GetComponentInParent <Player>().id; if (otherPlayerId != id) { bool isOnShip = GameServer.clients[otherPlayerId].player.data.is_on_ship; /*if (isOnShip) * { * ServerSend.DestroyPlayerCharacter(id, otherPlayerId); * }*/ ServerSend.ActivateShip(id, otherPlayerId); ServerSend.Stats(otherPlayerId, id); ServerSend.Buffs(otherPlayerId, id); } } else if (other.name.Equals("PlayerSphere")) { int otherPlayerId = other.GetComponentInParent <PlayerCharacter>().id; if (otherPlayerId != id) { ServerSend.ActivatePlayerCharacter(id, otherPlayerId); ServerSend.Stats(otherPlayerId, id); ServerSend.Buffs(otherPlayerId, id); Player player = GameServer.clients[otherPlayerId].player; if (player.playerMovement.agent.enabled) { ServerSend.DeactivatePlayerMovement(otherPlayerId, player.playerInstance.transform.position); } else { ServerSend.ActivatePlayerMovement(otherPlayerId, player.playerInstance.transform.position); } } } else if (other.tag.Equals("Resource")) { gatheringEnabled = true; currentResource = other.gameObject; } else if (other.tag.Equals("Dock")) { dock = other.gameObject; isOnDock = true; } else if (other.tag.Equals("CraftingSpot")) { craftingEnabled = true; craftingSpot = other.GetComponent <CraftingSpot>(); } else if (other.tag == "Trader") { tradingEnabled = true; trader = other.gameObject.GetComponent <Trader>(); } else if (other.tag == "TradeBroker") { tradeBrokerEnabled = true; } else if (other.tag == "Weapon") { PlayerAttack.OnPlayerAttack(this, other); } else if (other.name.Equals("NPCSphere")) { int npcId = other.GetComponentInParent <NPC>().id; ServerSend.NPCStats(npcId, id); ServerSend.ActivateNPC(id, npcId); } else if (other.name.Equals("DamageCollider")) { NPC npc = other.GetComponentInParent <NPC>(); DamageColliderInfo info = other.GetComponent <DamageColliderInfo>(); NPCAttack.OnNPCAttack(info, npc, this); } }
public virtual bool DisableMultipleCollision(DamageColliderInfo info, PlayerCharacter receiver) { return(false); }
public virtual void DamageCollision(DamageColliderInfo info, PlayerCharacter receiver) { }
public virtual float AbilityDamage(DamageColliderInfo info) { return(0); }