public void InitializeProjectileNormalBehavior(BaseCharacter spellCaster) { curTargetStat = TargetStats.health; curTargetType = TargetType.UnitOnly; curSkillOwner = spellCaster.teamType; skillInformation = new BaseSkillInformationData(); skillInformation.targetInflictedCount = -UnityEngine.Random.Range(spellCaster.unitInformation.minDamage, spellCaster.unitInformation.maxDamage); skillInformation.targetStats = TargetStats.health; skillInformation.targetType = TargetType.UnitOnly; skillInformation.targetAlive = true; targetPos = spellCaster.myMovements.currentTargetPoint.transform.position; if (targetPos.x > transform.position.x) { projectileVisualSprite.flipX = true; } else { projectileVisualSprite.flipX = false; } startMoving = true; }
public override void ApplyEffect() { base.ApplyEffect(); TargetStats.CanUseSpells = false; TargetStats.TakeDamage(SourceStats, 0, EffectPower); }
public override void ApplyEffect() { base.ApplyEffect(); TargetStats.CanMove = false; TargetStats.TakeDamage(SourceStats, EffectPower, EffectMagicDamage); }
public override void Use() { if (UseTime.AddSeconds(EffectDuration) < DateTime.UtcNow) { UseTime = DateTime.UtcNow; TargetStats.RemoveNegativeEffects(); } }
public void Set(TargetStats stats, Vector3 location, float stayTime) { Stats = stats; SpriteRenderer.sprite = stats.Sprite; Location = location; StayTime = stayTime; _isMovingIn = true; }
public void ReceiveHealing(float amount, UnitAttackType attackType, TargetStats targetStats) { unitInformation.ReceiveHealing(amount, targetStats); if (targetStats == TargetStats.health) { overheadHealthbar.UpdateHealthBar(unitInformation.curhealth, unitInformation.maxHealth); } }
public override void UpdateEffect() { elapsed += Time.deltaTime; if (elapsed > EffectDuration / EffectRate) { TargetStats.TakeLethalDamage(SourceStats, EffectPower, 0); elapsed = 0; } base.UpdateEffect(); }
public void InitializeTileUnitsTargetBehavior(TileConversionHandler newTargetTile, BaseSkillInformationData newSkillInformation, TeamType ownerTeam, TeamType newTargetTeam) { skillInformation = new BaseSkillInformationData(); skillInformation = newSkillInformation; curSkillOwner = ownerTeam; targetTeam = newTargetTeam; curTargetType = skillInformation.targetType; curTargetStat = skillInformation.targetStats; targetTile = newTargetTile; myAnim.Play(); }
public void InitializeUnitOnlyTargetBehavior(List <BaseCharacter> newTargetUnits, BaseSkillInformationData newSkillInformation, TeamType ownerTeam, TeamType newTargetTeam) { skillInformation = new BaseSkillInformationData(); skillInformation = newSkillInformation; curSkillOwner = ownerTeam; targetTeam = newTargetTeam; curTargetType = skillInformation.targetType; curTargetStat = skillInformation.targetStats; targetUnits = new List <BaseCharacter>(); targetUnits.AddRange(newTargetUnits); myAnim.Play(); }
public void ReceiveHealing(float healAmount, TargetStats targetStats) { float checkAmount = 0; switch (targetStats) { case TargetStats.health: checkAmount = curhealth + healAmount; if (checkAmount >= maxHealth) { curhealth = maxHealth; } else { curhealth += healAmount; } break; case TargetStats.damage: minDamage += healAmount; maxDamage += healAmount; break; case TargetStats.speed: origSpeed += healAmount; break; case TargetStats.range: range += healAmount; break; case TargetStats.blockProjectile: blockProjectile += healAmount; break; case TargetStats.blockMelee: blockMelee += healAmount; break; default: break; } }
public override void UpdateEffect() { elapsed += Time.deltaTime; if (elapsed > EffectDuration / EffectRate) { if (StatIndex == 28) { TargetStats.ModifyHealth(EffectPower); } else { TargetStats.ModifyMana(EffectPower); } elapsed = 0; } base.UpdateEffect(); }
private void OnHealthModified(float healthModified) { TargetStats.TakeDamage(SourceStats, 0, healthModified * 0.33f); }
public void ReceiveDamage(float damageAmount, TargetStats targetStats) { float checkAmount = 0; switch (targetStats) { case TargetStats.health: checkAmount = curhealth - damageAmount; if (checkAmount <= 0) { curhealth -= damageAmount; if (curhealth <= deathThreshold) { currentState = UnitState.Dead; } else { currentState = UnitState.Injured; } } else { curhealth -= damageAmount; } break; case TargetStats.damage: checkAmount = minDamage - damageAmount; if (checkAmount <= 0) { minDamage = 0.1f; } else { minDamage -= damageAmount; } checkAmount = maxDamage - damageAmount; if (checkAmount <= 0) { maxDamage = 0.2f; } else { maxDamage -= damageAmount; } break; case TargetStats.speed: checkAmount = origSpeed - damageAmount; if (checkAmount <= 0) { origSpeed = 0.1f; } else { origSpeed -= damageAmount; } break; case TargetStats.range: checkAmount = range - damageAmount; if (checkAmount <= 0) { range = 0.1f; } else { range -= damageAmount; } break; case TargetStats.blockProjectile: blockProjectile -= damageAmount; break; case TargetStats.blockMelee: blockMelee -= damageAmount; break; default: break; } }
public static Dictionary <TargetStat, double> GetTargetStats(this Structure s, PlanningItem pi, DoseValue referenceDose, params TargetStat[] desiredStats) { Dictionary <TargetStat, double> stats = new Dictionary <TargetStat, double>(); foreach (var ds in desiredStats) { switch (ds) { case TargetStat.CONFORMITY_INDEX_RTOG: stats.Add(TargetStat.CONFORMITY_INDEX_RTOG, TargetStats.GetCI_RTOG(s, pi, referenceDose)); break; case TargetStat.CONFORMITY_INDEX_PADDICK: stats.Add(TargetStat.CONFORMITY_INDEX_RTOG, TargetStats.GetCI_Paddick(s, pi, referenceDose)); break; } } return(stats); }
public void ReceiveDamage(float amount, UnitAttackType attackType, TargetStats targetStats) { UpdateCharacterState(CharacterStates.Damage_Received); bool blockAttempt = false; if (unitInformation.buffList != null && unitInformation.buffList.Count > 0) { List <BaseBuffInformationData> activateThisBuffs = unitInformation.buffList.FindAll(x => x.buffTrigger == TriggeredBy.ReceivingDamage); for (int i = 0; i < activateThisBuffs.Count; i++) { switch (activateThisBuffs[i].targetStats) { case TargetStats.health: break; case TargetStats.damage: // decrease damage increae damage amount += activateThisBuffs[i].effectAmount; break; case TargetStats.speed: break; case TargetStats.range: break; case TargetStats.blockMelee: if (!blockAttempt && attackType == UnitAttackType.MELEE) { blockAttempt = IsBlockAttemptSuccess(activateThisBuffs[i].effectAmount); } break; case TargetStats.blockProjectile: if (!blockAttempt && attackType == UnitAttackType.RANGE) { blockAttempt = IsBlockAttemptSuccess(activateThisBuffs[i].effectAmount); } break; default: break; } } } if (blockAttempt) { switch (attackType) { case UnitAttackType.MELEE: mySfx.PlayBlockMelee(); break; case UnitAttackType.RANGE: mySfx.PlayBlockProjectile(); break; case UnitAttackType.SPELL: break; default: break; } return; } switch (attackType) { case UnitAttackType.MELEE: mySfx.PlayReceiveMelee(); break; case UnitAttackType.RANGE: mySfx.PlayReceiveProjectile(); break; case UnitAttackType.SPELL: break; default: break; } amount = Mathf.Abs(amount); unitInformation.ReceiveDamage(amount, targetStats); if (targetStats == TargetStats.health) { overheadHealthbar.UpdateHealthBar(unitInformation.curhealth, unitInformation.maxHealth, true);; } //Debug.Log("[ DAMAGE RECEIVED : " + amount + " RECEIVED BY:"+ unitInformation.unitName + " ]"); if (!isLeadingHero) { if (unitInformation.currentState == UnitState.Dead || unitInformation.currentState == UnitState.Injured) { UpdateCharacterState(CharacterStates.Injured_State); mySfx.PlayInjuredOrDead(); } } if (unitInformation.currentState != UnitState.Healthy) { if (BattlefieldSpawnManager.GetInstance != null) { BattlefieldSpawnManager.GetInstance.RemoveThisUnit(this, unitInformation.currentState); } } }