public void ShowDefence(bool isEnemy, ShipAttackTypes attackType, [Optional, DefaultParameterValue(0)] ShipHelpDefencePosition position) { this.attackType = attackType; base.Invoke("ActiveDefeceObj", this.showAttackTypeWaitTime[((int) attackType) - 1]); if (!this.isSelfDef) { this.defObj.transform.localPosition = this.helpDefencePositons[(int) position].localPosition; } if (isEnemy) { this.animSprite.FlipX = true; Vector3 localPosition = this.defObj.transform.localPosition; localPosition.x *= -1f; this.defObj.transform.localPosition = localPosition; } }
public static string getShipAttackTypeString(ShipAttackTypes warType) { switch (warType) { case ShipAttackTypes.Gun: return "炮击"; case ShipAttackTypes.AirGun: return "航弹"; case ShipAttackTypes.AirTorpedo: return "航空鱼雷"; case ShipAttackTypes.Torpedo: return "鱼雷"; case ShipAttackTypes.AntiSubmarine: return "反潜"; default: case ShipAttackTypes.None: return "无"; } }
public void ShowDefenceSelf(ShipAttackTypes types) { GameObjectUtil.InstantiateItemAsChildOf(this.selfDefeceFXPrefab, base.gameObject).GetComponent<ShowShipDefence>().ShowDefence(this.isEnemy, types, ShipHelpDefencePosition.Up); }
public void ShowDefenceAsHelper(ShipAttackTypes types, DamageParam dp) { GameObject obj2 = GameObjectUtil.InstantiateItemAsChildOf(this.helpDefeceFXPrefab, base.gameObject); ShipHelpDefencePosition up = ShipHelpDefencePosition.Up; if (dp.extraDefHelper < dp.index) { up = ShipHelpDefencePosition.Down; } obj2.GetComponent<ShowShipDefence>().ShowDefence(this.isEnemy, types, up); }
public void ShowBeAttackedAsHelper(DamageParam hurtAmount, ShipAttackTypes attackedType) { this.ShowBeAttacked(hurtAmount, attackedType); }
public void ShowBeAttacked(DamageParam damage, ShipAttackTypes attackedType) { this.ShowHurtInfo(damage); if ((attackedType != ShipAttackTypes.AntiSubmarine) && (damage.amount != 0)) { if ((attackedType == ShipAttackTypes.AirTorpedo) || (attackedType == ShipAttackTypes.Torpedo)) { this.ShowTorpedoExplode(); } else if (damage.isCritical == 0) { this.ShowNormalSmallExplode(); } else { this.ShowNormalBombExplode(); } } this.SetAttackColor(true); if (attackedType == ShipAttackTypes.Gun) { this.ShowBeGunAttackedShack(); } else { this.ShowBeBombAttackedShake(); } }