/// <summary> /// Check if this entity performed the attack. /// </summary> /// <param name="attacker">The attacker that performed the attack</param> private void CheckAttackPerformed(AttackLogic attacker) { if (attacker.gameObject == gameObject) { OnAttackPerformed(); } }
/// <summary> /// Gets references and sets up the controls. /// </summary> protected override void Awake() { base.Awake(); _attackLogic = GetComponent <AttackLogic>(); _interactLogic = GetComponent <InteractLogic>(); SetUpControls(); }
private void Awake() { _playerState = GetComponent <PlayerState>(); _movable = GetComponent <Movable>(); _attackLogic = GetComponent <AttackLogic>(); _probability = new Probability(); }
public int Action(int strength, double crit, double multiplier, int increase) { var dmg = 5 + strength * 4; crit = crit + 25; return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase)); }
private void Awake() { _playerState = GetComponent <PlayerState>(); _attackLogic = GetComponent <AttackLogic>(); OnHealthUpdated(100); OnSaturationUpdated(100); OnHydrationUpdated(100); }
void OnTriggerEnter(Collider col) { if (col.transform.GetComponentInParent <AttackLogic> () != attackController) { attackController = col.transform.GetComponentInParent <AttackLogic> (); } StoreImpactInfo(attackController.GetCurrentAttack()); if (OnImpact != null) { OnImpact(this, new OnReceivingHitEventArgs(attackController, gameObject)); } }
protected override void Awake() { base.Awake(); // init components _wanderAI = new WanderAI(); if (isAggressive) { _attackLogic = GetComponent <AttackLogic>(); if (!_attackLogic) { Debug.LogError("NPC is not able to attack without an AttackLogic component."); } } }
private void PerformAttack(MonsterOnTheField monster, BattleManager bm, AttackLogic.AttackType at, UnityEngine.Events.UnityAction doneCallback) { AttackLogic attack = monster.m_MyMonster.IsAwakened() ? m_NormalAbilities[(int)at] : m_AwakenedAbilities[(int)at]; if (attack != null) { attack.PlayLogic(monster, bm, doneCallback); } else { if (doneCallback != null) { doneCallback(); } } }
void ImpactAnalysis(object sender, OnReceivingHitEventArgs e) { Attack incomingAttack = e.attackLogic.lightAttacks [e.attackLogic.comboNumber]; AttackLogic logic = e.attackLogic; if (activeStatus != Status.Idle) { if (activeStatus == Status.Blocking) { health.Hurt(incomingAttack.damage / 2); if (incomingAttack.specialQuality == Specials.Knockback) { } } } else { health.Hurt(incomingAttack.damage); } }
// Use this for initialization void Start() { rot = new Rotation(transform); rot.setRight(); position = new Vector2Int((int)Mathf.Round(transform.position.x), (int)Mathf.Round(transform.position.y)); xDir = 0; yDir = 0; canMove = true; GameObject masterObj = GameObject.Find("Master"); master = masterObj.GetComponent <Master>(); master.entityMap[position.x, position.y] = this.gameObject; GameObject controllerObj = GameObject.Find("Controller"); controller = controllerObj.GetComponent <Controller>(); attackLogic = GameObject.Find("AttackLogic").GetComponent <AttackLogic>(); }
public int Poison(int strength) { var dmg = Convert.ToInt32(strength * .25); return(AttackLogic.CalculateAttackDamage(dmg, 0, 1, 0)); }
public AttackAction(AttackLogic al, ObjectInteraction i) { logic = al; interaction = i; }
public TargetState(AttackLogic attackLogic) { _attackLogic = attackLogic; }
public int DoT(int spellPower, double crit, double multi, int increase) { var dmg = Convert.ToInt32(spellPower * .9); return(AttackLogic.CalculateAttackDamage(dmg, crit, multi, increase)); }
public int Action(int sp, double crit, double multiplier, int increase) { var heal = sp * 3; return(AttackLogic.CalculateAttackDamage(heal, crit, multiplier, increase)); }
public int Action(int spellPower, double crit, double multiplier, int increase) { var dmg = spellPower * 3; return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase)); }
public int DoT(int sp, double crit, double multiplier, int increase) { var dmg = Convert.ToInt32(sp * .7); return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase)); }
public int Action(int spellPower, double crit, double multiplier, int increase) { var value = Convert.ToInt32(spellPower * 1.4); return(AttackLogic.CalculateAttackDamage(value, crit, multiplier, increase)); }
public void Test1() { Assert.AreEqual(200, AttackLogic.CalculateAttackDamage(100, 20, 1, 0)); }
public int Action(int spellPower, double crit, double multi, int increase) { var heal = Convert.ToInt32(spellPower * 2.2); return(AttackLogic.CalculateAttackDamage(heal, crit, multi, increase)); }
public int Action(int spellpower, double crit, double multiplier, int increase) { var dmg = Convert.ToInt32(spellpower * 1.5); return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase)); }
private void Init() { m_NormalAbilities = new AttackLogic[(int)AttackLogic.AttackType.Count]; m_AwakenedAbilities = new AttackLogic[(int)AttackLogic.AttackType.Count]; m_AssetInfo = new PrefabManager.AssetPathInfo(m_Params.Params.AssetFolder, m_Params.Params.AssetName); m_AssetInfo.m_Scale = m_Params.Params.m_Scale; var attacks = m_Params.Params.Attacks; if (attacks != null) { m_AllAttacks = new List <AttackLogic>(attacks.Length); for (int i = 0; i < attacks.Length; i++) { AttackLogic al = MonstersManager.GetAttackLogc(attacks[i]); if (al == null) { Debug.LogError("Attack wasn't found " + attacks[i] + " for mob " + m_Params.Params.Name); } else { m_AllAttacks.Add(al); } } for (int i = 0; i < m_AllAttacks.Count; i++) { if (!m_AllAttacks[i].m_AwakenedAbility) { if (m_AllAttacks[i].m_AttackType == AttackLogic.AttackType.Passive) { if (m_PassiveAbilities == null) { m_PassiveAbilities = new List <AttackLogic>(); } if (m_PassiveAwakenAbilities == null) { m_PassiveAwakenAbilities = new List <AttackLogic>(); } m_PassiveAbilities.Add(m_AllAttacks[i]); m_PassiveAwakenAbilities.Add(m_AllAttacks[i]); } else { m_AwakenedAbilities[(int)m_AllAttacks[i].m_AttackType] = m_NormalAbilities[(int)m_AllAttacks[i].m_AttackType] = m_AllAttacks[i]; } } } for (int i = 0; i < m_AllAttacks.Count; i++) { if (m_AllAttacks[i].m_AwakenedAbility) { if (m_AllAttacks[i].m_AttackType == AttackLogic.AttackType.Passive) { if (m_PassiveAwakenAbilities == null) { m_PassiveAwakenAbilities = new List <AttackLogic>(); } m_PassiveAwakenAbilities.Add(m_AllAttacks[i]); } else { m_AwakenedAbilities[(int)m_AllAttacks[i].m_AttackType] = m_AllAttacks[i]; } } } } }
public CancelState(AttackLogic attackLogic) { _attackLogic = attackLogic; }
private void Awake() { _maxHealth = health; _attackLogic = GetComponent <AttackLogic>(); _enemyController = GetComponent <EnemyController>(); }
public int Action(int SpellPower, double crit, double multi, int increase) { return(AttackLogic.CalculateAttackDamage(SpellPower, crit, multi, increase)); }
public OnReceivingHitEventArgs(AttackLogic targetAttackLogic, GameObject newhurtbox) { attackLogic = targetAttackLogic; hurtbox = newhurtbox; }
public int Action(int strength, double crit, double multiplier, int increase) { var dmg = Convert.ToInt32(strength * 2.2); return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase)); }
public AttackController(AttackLogic attackLogic) { _attackLogic = attackLogic; }
public int Action(int strength, double crit, double multiplier, int increase) { return(AttackLogic.CalculateAttackDamage(strength, crit, multiplier, increase)); }
public AttackState(AttackLogic attackLogic) { _attackLogic = attackLogic; }