Object ToHitType(String s) { if (s.Length > 2) { return(Failure); } AttackClass aclass = AttackClass.None; AttackPower apower = AttackPower.None; if (Char.ToUpper(s[0]) == 'N') { apower = AttackPower.Normal; } else if (Char.ToUpper(s[0]) == 'H') { apower = AttackPower.Hyper; } else if (Char.ToUpper(s[0]) == 'S') { apower = AttackPower.Special; } else if (Char.ToUpper(s[0]) == 'A') { apower = AttackPower.All; } else { return(Failure); } if (s.Length == 1) { aclass = AttackClass.All; } else { if (Char.ToUpper(s[1]) == 'T') { aclass = AttackClass.Throw; } else if (Char.ToUpper(s[1]) == 'P') { aclass = AttackClass.Projectile; } else if (Char.ToUpper(s[1]) == 'A') { aclass = AttackClass.Normal; } else { return(Failure); } } return(new Combat.HitType(aclass, apower)); }
public void beHit(AttackPower attackPower) { if ((int)attackPower >= defenceLevel) { beKill(); } else { beHurt(); } }
void initialBoom(float rotateTime) { float basef = 10; //if (rotateTime >= 0.5) // basef = 5; //if (rotateTime >= 0.7) // basef = 10; //if (rotateTime >= 0.8) // basef = 20; //if(rotateTime >= 0.9) // basef = 30; //if (rotateTime >= 1) // basef = 50; //if (rotateTime >= 1.1) // basef = 70; //if (rotateTime >= 1.2) // basef = 90; //if (rotateTime >= 1.3) // basef = 110; //if (rotateTime >= 1.4) // basef = 130; float booMPower = rotateTime * rotateTime * basef + 0.2f; AttackPower attackPower = AttackPower.pa; if (booMPower >= 6.2f) { attackPower = AttackPower.boom; centerController.showNotify("DOOM", Color.red, attackPower); } else if (booMPower > 3f) { attackPower = AttackPower.dong; centerController.showNotify("Dong", Color.yellow, attackPower); } else { attackPower = AttackPower.pa; centerController.showNotify("Pa", Color.white, attackPower); } // Debug.Log("Roteta" + rotateTime * rotateTime *basef+ "velo " ); GameObject a = Instantiate(BoomEFprefab, armController.getHitPos(), Quaternion.identity); a.transform.localScale *= 1 + rotateTime * 2; a.GetComponent <BoomEF>().beCreat(attackPower); CinemachineCollisionImpulseSource cs = this.GetComponent <CinemachineCollisionImpulseSource>(); cs.m_ImpulseDefinition.m_AmplitudeGain = booMPower; cs.GenerateImpulse(); }
/// <summary> /// Launchs the attack. /// </summary> /// <returns><c>true</c>, if attack was launched, <c>false</c> otherwise.</returns> /// <param name="attack">The power of the Attack. 0 -> Quick, 1-> Long</param> public bool LaunchAttack(AttackPower attack) { if (IsBlocking() || attacking) { return(false); } currentAttack = attack; if (!GetCurrentAttack().Ready()) { return(false); } attackTimer = GetCurrentAttack().duration; attacking = true; // start attack animation return(true); }
public void showHit(string s, Color color, AttackPower attackPower) { ani = this.GetComponent <Animator>(); this.notice = s; Text text = this.GetComponentInChildren <Text>(); text.text = notice; text.color = color; switch (attackPower) { case AttackPower.pa: ani.Play("SmallHit"); break; case AttackPower.boom: ani.Play("MidHit"); break; case AttackPower.dong: ani.Play("MidHit"); break; } }
public override int GetHashCode() { int hash = 1; if (Nickname.Length != 0) { hash ^= Nickname.GetHashCode(); } if (Level != 0) { hash ^= Level.GetHashCode(); } if (DistanceWalkedKm != 0F) { hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DistanceWalkedKm); } if (MaxHp != 0L) { hash ^= MaxHp.GetHashCode(); } if (AttackPower != 0L) { hash ^= AttackPower.GetHashCode(); } if (PlayerTeamId.Length != 0) { hash ^= PlayerTeamId.GetHashCode(); } if (ProfessionId.Length != 0) { hash ^= ProfessionId.GetHashCode(); } if (TitleId.Length != 0) { hash ^= TitleId.GetHashCode(); } hash ^= unlockedTitleIds_.GetHashCode(); if (ThemeId.Length != 0) { hash ^= ThemeId.GetHashCode(); } hash ^= unlockedThemeIds_.GetHashCode(); if (HouseId.Length != 0) { hash ^= HouseId.GetHashCode(); } if (wand_ != null) { hash ^= Wand.GetHashCode(); } hash ^= favoriteBadgeIds_.GetHashCode(); hash ^= unlockedBadgeIds_.GetHashCode(); hash ^= favoriteTitleIds_.GetHashCode(); if (FirstName.Length != 0) { hash ^= FirstName.GetHashCode(); } if (LastName.Length != 0) { hash ^= LastName.GetHashCode(); } if (ProfileCreationLocation.Length != 0) { hash ^= ProfileCreationLocation.GetHashCode(); } hash ^= unlockedSelfieAssetIds_.GetHashCode(); if (TotalSwishSuccessSpell != 0L) { hash ^= TotalSwishSuccessSpell.GetHashCode(); } hash ^= discoveredPotionsMasterNoteIds_.GetHashCode(); if (emailOpts_ != null) { hash ^= EmailOpts.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public string GetStatInfo() { string info = ""; if (AttackPower != 0) { info += "Attack Power: " + AttackPower.ToString() + "\n"; } if (PhysicalHaste != 0) { info += "P. Haste: " + PhysicalHaste.ToString() + "%\n"; } if (PhysicalHitChance != 0) { info += "P. Hit Chance: " + PhysicalHitChance.ToString() + "%\n"; } if (PhysicalCritChance != 0) { info += "P. Crit Chance: " + PhysicalCritChance.ToString() + "%\n"; } if (PhysicalCritPower != 0) { info += "P. Crit Power: " + PhysicalCritPower.ToString() + "\n"; } if (PhysicalReduction != 0) { info += "P. Reduction: " + PhysicalReduction.ToString() + "%\n"; } if (PhysicalReflection != 0) { info += "P. Reflection: " + PhysicalReflection.ToString() + "%\n"; } if (PhysicalAvoidance != 0) { info += "P. Avoidance: " + PhysicalAvoidance.ToString() + "%\n"; } if (SpellPower != 0) { info += "Spell Power: " + SpellPower.ToString() + "\n"; } if (SpellHaste != 0) { info += "S. Haste: " + SpellHaste.ToString() + "%\n"; } if (SpellHitChance != 0) { info += "S. Hit Chance: " + SpellHitChance.ToString() + "%\n"; } if (SpellCritChance != 0) { info += "S. Crit Chance: " + SpellCritChance.ToString() + "%\n"; } if (SpellCritPower != 0) { info += "S. Crit Power: " + SpellCritPower.ToString() + "\n"; } if (SpellReduction != 0) { info += "S. Reduction: " + SpellReduction.ToString() + "%\n"; } if (SpellReflection != 0) { info += "S. Reflection: " + SpellReflection.ToString() + "%\n"; } if (SpellAvoidance != 0) { info += "S. Avoidance: " + SpellAvoidance.ToString() + "%\n"; } if (BonusHealth != 0) { info += "Bonus Health: " + BonusHealth.ToString() + "\n"; } if (BonusMana != 0) { info += "Bonus Mana: " + BonusMana.ToString() + "\n"; } return(info); }
public HitType(AttackClass aclass, AttackPower apower) { m_class = aclass; m_power = apower; }
public void showNotify(string message, Color color, AttackPower attackPower) { GameObject a = Instantiate(notifierPrefab, this.transform.position, this.transform.rotation); a.GetComponent <Notifier>().showHit(message, color, attackPower); }
public void InitializeAttack(float baseAttack, float attackMultiplierIncrementer, float attackMultiplier, float attackValueToMultiply) => AttackPower = new AttackPower(baseAttack, attackMultiplierIncrementer, attackMultiplier, attackValueToMultiply, HealthPower);
public void beCreat(AttackPower attackPower) { this.attackPower = attackPower; }
public SwordPowerAttribute(SwordPrimaryAttributeSet primary, AttackPower id) : base((int)id) { m_primary = primary; }