help for my code

  1. Combat between two creature cards: Reduce the defending creatures HP by the attack power of the attacking creature card AND reduce the attacking creatures HP by the attack power of the defending creature card. If either the attacker or the defender or both of them is/are reduced to 0 HP or lower these creatures are destroyed.
    Special abilities:
    a. If the attacking creature has Trample ability, the excess amount of attack power is dealt to the opposing player (which can cause the opposing player dying). Here the excess amount of attack power is calculated as:
    Excess attack power = Attackers attack power defenders HP
    b. If the attacking creature has First Strike ability,
    i. If the defending creature also has First Strike ability, normal attack procedure.
    ii. If the defending creature does NOT have First Strike ability; then first the Attackers attack power is applied to the defenders HP. If the defender is destroyed then the combat stops here (i.e., the defender CANNOT deal its damage to the attacker)
    c. If the attacking creature does NOT have First Strike ability,
    i. If the defending creature has First Strike ability, then first the Defenders attack power is
    applied to the attackers HP. If the attacker is destroyed then the combat stops here (i.e., the
    attacker CANNOT deal its damage to the defender)
    ii. If the defending creature also does NOT have First Strike ability; normal attack procedure.
  2. Combat between one creature card and the opposing player: Reduce the HP of the opposing player by the attack power of the attacking creature card. If the opposing players HP is reduced to 0 or lower, that player loses the game.