void Awake() { lifeStoneManager = LifeStoneManager.Instance; inventoryManager = InventoryManager.Instance; playerController = GetComponent <PlayerController>(); attackProperty = GetComponentInChildren <AttackProperty>(); anim = GetComponent <Animator>(); aoc = new AnimatorOverrideController(anim.runtimeAnimatorController); anim.runtimeAnimatorController = aoc; }
void PlayerHit(AttackType type, AttackProperty properties) { if ((properties & AttackProperty.Explosive) == 0) { return; } var explosionGo = Instantiate(explosionPrefab, transform.position, Quaternion.identity); var explosion = explosionGo.GetComponent <Explosion>(); explosion.damage = 5; explosion.knockback = 5f; NetworkServer.Spawn(explosionGo); pooled.Release(); }
public static string getName(this AttackProperty type) { switch (type) { case AttackProperty.normal: return("通常"); case AttackProperty.beam: return("光束"); case AttackProperty.fire: return("火炎"); case AttackProperty.ice: return("冰冻"); case AttackProperty.electric: return("电气"); case AttackProperty.gas: return("瓦斯"); case AttackProperty.sonic: return("音波"); } return(""); }
//レート計算 private static int RateCalculation(Status myStatus, Status otherStatus, GameLevel level, AttackProperty attackProperty) { return((int)((20 + CorrectionCalculation(myStatus, otherStatus, level)) * PropertyRate())); }
//ダメージ public static int Damege(GameObject me, GameObject other, GameLevel level, AttackType attackType, AttackProperty attackProperty) { Status myStatus = null; //自分のステータス Status otherStatus = null; //相手のステータス int damege; //ダメージ myStatus = me.GetComponent <Status>(); otherStatus = other.GetComponent <Status>(); damege = 0; damege += RateCalculation(myStatus, otherStatus, level, attackProperty); switch (attackType) { case AttackType.Physical: damege += PhysicalDamege(myStatus, otherStatus); break; case AttackType.Magic: damege += MagicDamege(myStatus, otherStatus); break; default: break; } return(damege); }
public Hitbox(int damage, int chipDamage, int hitstun, int blockstun, Vector2 pushback, Rectangle hitboxBounds, Vector2 positionOffset, CancelState cancelStrength, HitSpark attackStrength, AttackProperty attackProperty = AttackProperty.Hit, int pushbackDuration = 5, int hitStop = -1, bool ignorePushback = false, ThrowType throwType = ThrowType.none) { this.damage = damage; this.chipDamage = chipDamage; this.hitstun = hitstun; this.blockstun = blockstun; this.pushbackDuration = pushbackDuration; this.pushback = pushback; this.hitboxBounds = hitboxBounds; this.positionOffset = positionOffset; this.attackProperty = attackProperty; this.cancelStrength = cancelStrength; this.attackStrength = attackStrength; this.ignorePushback = ignorePushback; this.throwType = throwType; moveMasterID = MasterObjectContainer.GetMoveMasterID(); moveCurrentUseID = 0; if (hitStop == -1) { if (attackStrength == HitSpark.light) { this.hitStop = 5; } else if (attackStrength == HitSpark.medium) { this.hitStop = 7; } else if (attackStrength == HitSpark.heavy) { this.hitStop = 9; } else { this.hitStop = 11; } } else { this.hitStop = hitStop; } }