public void PlaySpell(SpellValues spell) { spellAudio.loop = false; spellAudio.clip = spell.spellSound; spellAudio.Play(); }
public void HandleCoolDownIncrease(SpellValues spell) { if (spell.spellCastPerturn != 0) { spell.spellCastPerturncounter++; } if ((spell.spellCastPerturncounter >= spell.spellCastPerturn && spell.spellCastPerturn != 0) || spell.spellCooldown > 0) { spell.spellCooldownLeft = spell.spellCooldown; } }
public void HandleCooldownDecrease(SpellValues spell) { if (spell.spellInitialCooldowncounter > 0) { spell.spellInitialCooldowncounter--; } if (spell.spellCooldownLeft > 0) { spell.spellCooldownLeft--; } spell.spellCastPerturncounter = 0; }
public void SpellCancel() { if (mc.rangeTiles != null) { mc.ResetTileMaterials(mc.rangeTiles); mc.rangeTiles = null; } if (mc.nullTiles != null) { mc.ResetTileMaterials(mc.nullTiles); mc.nullTiles = null; } if (mc.targetedTiles != null) { mc.ResetTileMaterials(mc.targetedTiles); mc.targetedTiles = null; } currentSpell = null; spellOpen = false; }
public void Aftermath() { playerBehaviour.currentCharacter.currentAp -= currentSpell.spellApCost; if (mc.rangeTiles != null) { mc.ResetTileMaterials(mc.rangeTiles); mc.rangeTiles = null; } if (mc.nullTiles != null) { mc.ResetTileMaterials(mc.nullTiles); mc.nullTiles = null; } if (mc.targetedTiles != null) { mc.ResetTileMaterials(mc.targetedTiles); mc.targetedTiles = null; } currentSpell = null; spellOpen = false; UpdateHpApMp(); playerBehaviour.UpdateTabs(); }
public void Spell6Cast() { SpellCancel(); currentSpell = cv.spell_6; spellOpen = true; }
public void HandleCooldownReset(SpellValues spell) { spell.spellInitialCooldowncounter = spell.spellInitialCooldown; spell.spellCooldownLeft = 0; spell.spellCastPerturncounter = 0; }
public void CastSpell(SpellValues spell, CharacterValues caster, Tile currentMouseTile) { playerBehaviour.aControll.PlayAttack(caster); playerBehaviour.aControll.PlaySpell(spell); Tile casterTile = gridController.GetTile(caster.currentTile.x, caster.currentTile.z); Tile targetTile = currentMouseTile; //Tile temp1 = gridController.GetTile(caster.currentTile.x,caster.currentTile.z); //Tile temp2 = gridController.GetTile(target.currentTile.x,target.currentTile.z); List <Tile> targetsList = abilities.AreaType(currentSpell.mySpellAreaType); int leach = 0; foreach (var item in targetsList) { PlayerInfo checker = item.CharCurrentlyOnTile; CharacterValues target = null; if (checker) { target = checker.thisCharacter; } if (target) { int damageStuff = 0; int healingIsFun = 0; if (spell.healsAlly == true) { if (target.team == caster.team) { healingIsFun = TrueHealCalculator(spell.spellHealMax, spell.spellHealMin, target.healsReceived); } else { damageStuff = TrueDamageCalculator(spell.spellDamageMax, spell.spellDamageMin, caster.damageChange, target.armorChange, caster.damagePlus, target.armorPlus); } } else if (spell.hurtsAlly == false) { if (target.team != caster.team) { damageStuff = TrueDamageCalculator(spell.spellDamageMax, spell.spellDamageMin, caster.damageChange, target.armorChange, caster.damagePlus, target.armorPlus); } } else { damageStuff = TrueDamageCalculator(spell.spellDamageMax, spell.spellDamageMin, caster.damageChange, target.armorChange, caster.damagePlus, target.armorPlus); } leach = leach + damageStuff; GetHit(target, damageStuff); GetHealed(target, healingIsFun); if (spell.effect && spell.effectOnTarget == true && target != caster) { sEffects.ApplyEffect(caster, spell.effect, target); playerBehaviour.UpdateTabs(); } if (spell.effect && spell.effectOnCaster == true && target == caster) { sEffects.ApplyEffect(caster, spell.effect, target); playerBehaviour.UpdateTabs(); } } } if (spell.damageStealsHp == true) { StealHp(caster, leach); } if (spell.spellPull != 0) { //abilities.SpellPull(spell.mySpellPullType); } if (spell.spellPushback != 0) { //abilities.SpellPush(spell.mySpellPushType); } if (spell.moveCloserToTarget != 0) { //abilities.WalkTowardsTarget(); } if (spell.moveAwayFromTarget != 0) { //abilities.MoveAwayFromTarget(); } if (spell.teleportToTarget == true) { abilities.CasterTeleport(casterTile); } if (spell.chagePlaceWithTarget == true) { abilities.TeleportSwitch(casterTile, targetTile); } HandleCoolDownIncrease(spell); UpdateHpApMp(); }
public void UpdateInfo(SpellValues x) { spell = x; }