public Hit GetHitStats(float wepDmg, AtkType wepType) //change to work with playercombat and weapons. Base Damage. { //TODO: Update, to return a full Hitstats. //update movespeed and attack speed soon. hitStats = new Hit(); hitStats.Owner = this.gameObject; hitStats.atkType = hitType; callDmgStats(); //Apply perks, twists, and events. switch (wepType) { case AtkType.Magic: hitStats.Dmg = wepDmg + (Intelligence.Amt * lvl); return(hitStats); case AtkType.Range: hitStats.Dmg = wepDmg + (Dexterity.Amt * lvl); return(hitStats); case AtkType.Melee: hitStats.Dmg = wepDmg + (Strength.Amt * lvl); return(hitStats); default: Debug.Log("STAT: Attack of no type"); hitStats.Dmg = wepDmg; return(hitStats); } }
public void updateLastAttack(AtkType t) { if (t != lastAttack) { lastAttack = t; alreadyHitByType = new List <GameObject>(); } }
public AtkType atkType; // 攻击属于远程还是近程(决定是否产生飞行道具) public Hero(int code, VInt speed, VInt atkSpeed, VInt atkRange, int hpMax, VInt atkTime, AtkType atkType) { this.code = code; this.speed = speed; this.atkSpeed = atkSpeed; this.atkRange = atkRange; this.hpMax = hpMax; this.atkTime = atkTime; this.atkType = atkType; }
// Use this for initialization void Start() { ci = GetComponent <Interpreter>(); combo = GetComponent <ComboCounter>(); pm = GetComponent <PlayerMover>(); source = GetComponent <AudioSource>(); lastAttack = AtkType.None; if (TouchAttack) { currentTouchAttack = Instantiate(TouchAttack, transform); } }
public SPELLS(bool buyable, bool sellable, string name, string Description, int buyPrice, int sellPrice, int ManaUse, SpellType spellType, AtkType atkType, float FireDam, float MagicDam, float ArtDam) : base(buyable, sellable, false, name, Description, true, ITEMS.Type.Item, buyPrice, sellPrice, false, 1, 1, ITEMS.StatBoost.None, 0, 0, ITEMS.typeOfItem.None) { //itemName = name; //itemDescription = Description; manaUse = ManaUse; type = spellType; this.atkType = atkType; fireDam = FireDam; magicDam = MagicDam; artDam = ArtDam; }
void Start() { bl = GetComponent <BulletStatusC>(); hitEffect = bl.hitEffect; popup = bl.Popup; attackType = bl.AttackType; element = bl.element; variance = bl.variance; ApplyDamage(); if (duration > 0) { Destroy(gameObject, duration); } }
public void LaunchAttack(AtkType thetype) { switch (thetype) { case AtkType.swing: StartCoroutine("Swing"); break; case AtkType.block: break; case AtkType.spthrow: break; case AtkType.spstab: break; default: break; } }
public void WeaponGenerator() { if (isGenerated == true) { int AT = Random.Range(0, 2); switch (AT) { case 0: atkType = 0; int WT = Random.Range(0, 2); switch (WT) { case 0: weaponType = 0; weaponRarity = 0; weaponMaterial = 0; Name = "axe"; BaseAtk = Random.Range(10, 16); BaseRng = 1; APCost = 1; if (AxeHandle != null) { GameObject axe = Instantiate(AxeHandle[Random.Range(0, AxeHandle.Length)], transform.position, transform.rotation); axe.transform.parent = gameObject.transform; if (AxeBlade != null) { GameObject bladeSocket = GameObject.FindGameObjectWithTag("Blade"); GameObject blade = Instantiate(AxeBlade[Random.Range(0, AxeBlade.Length)], bladeSocket.transform.position, bladeSocket.transform.rotation); blade.transform.parent = axe.transform; } } break; case 1: weaponType = WeaponType.Dagger; weaponRarity = 0; weaponMaterial = 0; Name = "dagger"; BaseAtk = Random.Range(10, 16); BaseRng = 1; APCost = 1; if (DaggerHandle != null) { GameObject dagger = Instantiate(DaggerHandle[Random.Range(0, DaggerHandle.Length)], transform.position, transform.rotation); dagger.transform.parent = gameObject.transform; if (DaggerBlade != null) { GameObject bladeSocket = GameObject.FindGameObjectWithTag("Blade"); GameObject blade = Instantiate(DaggerBlade[Random.Range(0, DaggerBlade.Length)], bladeSocket.transform.position, bladeSocket.transform.rotation); blade.transform.parent = dagger.transform; } } break; } break; case 1: atkType = AtkType.Magic; WT = 2; switch (WT) { case 2: weaponType = WeaponType.Wand; weaponRarity = 0; weaponMaterial = 0; Name = "wand"; BaseAtk = Random.Range(10, 16); BaseRng = 7; APCost = 1; if (WandHandle != null) { GameObject wand = Instantiate(WandHandle[Random.Range(0, WandHandle.Length)], transform.position, transform.rotation); wand.transform.parent = gameObject.transform; if (WandTip != null) { GameObject bladeSocket = GameObject.FindGameObjectWithTag("Blade"); GameObject Tip = Instantiate(WandTip[Random.Range(0, WandTip.Length)], bladeSocket.transform.position, bladeSocket.transform.rotation); Tip.transform.parent = wand.transform; } } break; } break; } } }
public void atkFinished(AtkType t) { pm.atkFinished(t == AtkType.Finisher); Destroy(currentAttack); }
public int makeAttack(AtkType a) { switch (a) { case AtkType.DownAir: currentAttack = Instantiate(DownAir, transform, false); source.PlayOneShot(DownAir.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.NeutralAir: currentAttack = Instantiate(NeutralAir, transform, false); source.PlayOneShot(NeutralAir.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.UpAir: currentAttack = Instantiate(UpAir, transform, false); source.PlayOneShot(UpAir.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.ForwardAir: currentAttack = Instantiate(ForwardAir, transform, false); source.PlayOneShot(ForwardAir.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.BackAir: currentAttack = Instantiate(BackAir, transform, false); source.PlayOneShot(BackAir.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.DownGround: currentAttack = Instantiate(DownGround, transform, false); source.PlayOneShot(DownGround.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.UpGround: currentAttack = Instantiate(UpGround, transform, false); source.PlayOneShot(UpGround.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.BackGround: currentAttack = Instantiate(BackGround, transform, false); source.PlayOneShot(BackGround.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.ForwardGround: currentAttack = Instantiate(ForwardGround, transform, false); source.PlayOneShot(ForwardGround.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.NeutralGround: currentAttack = Instantiate(NeutralGround, transform, false); source.PlayOneShot(NeutralGround.GetComponent <Attack>().attackSound, hitVolume); break; case AtkType.Finisher: currentAttack = Instantiate(Finisher, transform, false); source.PlayOneShot(Finisher.GetComponent <Attack>().attackSound, finisherVolume); ComboCounter c = GetComponent <ComboCounter>(); currentAttack.GetComponent <AttackActive>().comboStrength = c.currentCombo; c.reset(); break; default: print("Not implemented"); currentAttack = Instantiate(NeutralAir, transform, false); break; } currentAttack.GetComponent <AttackActive>().setType(a); mf = currentAttack.GetComponent <MovePhysics>(); return(currentAttack.GetComponent <AttackActive>().atkFrames); }
public void resetHitList() { alreadyHitByType = new List <GameObject>(); lastAttack = AtkType.None; }