private void onLoseHp(Creature c, int damage, AbilityEffect source) { if (c is Monster && source == this.source) { Run(damage); } }
public virtual void ReceiveEffect(AbilityEffect effect) { switch (effect.TypeOfEffect) { case AbilityEffect.EffectType.Damage: var damageEffect = effect as DamageEffect; health.TakeDamage(damageEffect.Damage); break; case AbilityEffect.EffectType.DamageOverTime: var dotEffect = effect as DamageOverTimeEffect; health.TakeDamage(dotEffect.DamagePerSecond * Time.deltaTime); break; case AbilityEffect.EffectType.RelativeForce: //ToDo break; case AbilityEffect.EffectType.WorldForce: //ToDo break; default: return; } }
public void SetabilityEffect(PotionData potionData) { effectImage.sprite = potionData.Image; SetRemainingTurnText(AbilityEffectService.NUM_OF_INFINITY); abilityEffect = new AbilityEffect(potionData); }
public Ability(string n, AbilityEffect e, int eC = 0, int hC = 0) { name = n; effect = e; etherCost = eC; healthCost = hC; }
void SwapEffect(Ability abil, int source, int target) { AbilityEffect effect = abil.effects[source]; abil.effects[source] = abil.effects[target]; abil.effects[target] = effect; }
protected override void OnAbilityEffectHit(AbilityEffect areaOfEffect, Unit unitHit, bool isACriticalStrike, bool willMiss) { float damage = GetAbilityDamage(unitHit); DamageUnit(unitHit, damage); AbilityHit(unitHit, damage); }
public Ability(string n, AbilityEffect e, int eC = 0, int hC = 0) { name = n; effect = e; etherCost = eC; healthCost = hC; }
private void OnDeath(Creature c, AbilityEffect source) { if (c is Monster && source == this.source) { Run(); } }
public void MovePlayer(int from, int to, float counter = 0.25f) { tilePos = to; xPos = tilePos % 40; yPos = tilePos / 40; Player.name = "Player" + to.ToString(); AnimaUnit animaUnit = new AnimaUnit(); animaUnit.MoveUnit(Player, from, to, counter); Tile.passable[from] = true; Tile.passable[to] = false; PlayerStat playerStat = new PlayerStat(); playerStat.GainRage(-1); if (Artifact.titles[to] != Artifact.Title.None) { Artifact.Title title = Artifact.titles[to]; Artifact artifact = new Artifact(); artifact.Destroy(to); AbilityEffect ability = new AbilityEffect(); ability.GainArtifact(title); } Turn.currentTurn = Turn.CurrentTurn.PlayerNeutral; }
public void UseAbility(int tile) { if (abilitySelected < SIZE) { int i = abilitySelected; Distance distance = new Distance(); if (cooldown[i] == 0 && distance.GetDistanceToPlayer(tile) <= range[i]) { AbilityEffect ability = new AbilityEffect(); ability.UseAbility(i, tile); cooldown[i] = cooldownMax[i] + 1; DisplayAbility(i); UI ui = new UI(); ui.EndTurn(); if (PlayerStat.rage > 0) { PlayerStat playerStat = new PlayerStat(); playerStat.GainRage(1); } } } }
private void PassiveBasicAttackHit(AbilityEffect basicAttackProjectile, Unit unitHit, bool isACriticalStrike, bool willMiss) { if (!(unit.StatusManager.IsBlinded() || willMiss)) { basicAttackEmpoweringAbility.OnEmpoweredBasicAttackHit(unitHit, isACriticalStrike); } Destroy(basicAttackProjectile.gameObject); }
private void LogEvent(string actor, string[] targets, AbilityEffect abilityEffect, int effectMagnitude) { GameEvent gameEvent = new GameEvent(RoundCount, actor, targets, abilityEffect, effectMagnitude); LogEvent(gameEvent); }
/// <summary> /// 상태 효과 설정 /// </summary> /// <param name="scenarioData"></param> /// <returns>상태효과를 리턴</returns> public AbilityEffect SetabilityEffect(ScenarioData scenarioData) { effectImage.sprite = scenarioData.Image; SetRemainingTurnText(scenarioData.ApplyTurn); abilityEffect = new AbilityEffect(scenarioData); return(abilityEffect); }
private void OnAreaOfEffectHit(AbilityEffect projectile, Unit unitHit, bool isACriticalStrike, bool willMiss) { float damage = GetAbilityDamage(unitHit); DamageUnit(unitHit, damage); AddNewDebuffToAffectedUnit(unitHit); AbilityHit(unitHit, damage); }
public void ReplaceAbilityEffect(AbilityEffect newEffectObject) { var index = CardComponentsLookup.AbilityEffect; var component = CreateComponent <AbilityEffectComponent>(index); component.EffectObject = newEffectObject; ReplaceComponent(index, component); }
protected void DamageHealth(Character target, AbilityEffect effect) { target.ReceiveAttack( GM.RNG.RandiRange(1, 100) + accuracy + effect.BonusAccuracy, GM.RNG.RandiRange(powerLevel + effect.BonusFlatValue, (dieSidesPerPowerLevel + effect.BonusSides + 1)) * (powerLevel + effect.BonusDie), 1 ); }
protected void OnAbilityEffectGroundHit(AbilityEffect abilityEffect, List <Unit> previouslyAffectedUnits, List <Unit> affectedUnits) { AbilityDebuffs[0].AddNewBuffToAffectedUnits(previouslyAffectedUnits, affectedUnits); foreach (Unit affectedUnit in affectedUnits) { DamageUnit(affectedUnit, GetAbilityDamage(affectedUnit) / totalTicks); } }
protected override void OnAbilityEffectHit(AbilityEffect projectile, Unit unitHit, bool isACriticalStrike, bool willMiss) { if (effectType == AbilityEffectType.SINGLE_TARGET) { Destroy(projectile.gameObject); } AddNewDebuffToAffectedUnit(unitHit); }
/// <summary> /// Causes the effect to this person, and if it has any durations, adds the effect to the person's list. /// </summary> /// <param name="effectToTake">Effect to deal to this person.</param> public void takeEffect(AbilityEffect effectToTake) { takeDamage(effectToTake.Caster, effectToTake.DamageOnHit, effectToTake.EnergyDamage); if (effectToTake.DoTDuration + effectToTake.EoTDuration > 0) { effects.Add(effectToTake); } }
protected virtual void BasicAttackHit(AbilityEffect basicAttackProjectile, Unit unitHit, bool isACriticalStrike, bool willMiss) { if (!(unit.StatusManager.IsBlinded() || willMiss)) { ApplyDamageToUnitHit(unitHit, isACriticalStrike); } Destroy(basicAttackProjectile.gameObject); }
protected override void OnProjectileHit(AbilityEffect projectile, Unit unitHit, bool isACriticalStrike, bool willMiss) { foreach (Ability ability in champion.AbilityManager.CharacterAbilities) { ability.ReduceCooldown(cooldownReductionOnProjectileHit); } base.OnProjectileHit(projectile, unitHit, isACriticalStrike, willMiss); }
private void OnProjectileHit(AbilityEffect projectile, Unit unitHit, bool isACriticalStrike, bool willMiss) { float damage = GetAbilityDamage(unitHit); DamageUnit(unitHit, damage); AbilityHit(unitHit, damage); Destroy(projectile.gameObject); }
private void onLoseHp(Creature c, int damage, AbilityEffect source) { if (c is Player) { Run(damage); Run(); } }
////////////////////////////////////////////////// ///// STRUCTORS ////////////////////////////////// public GameEvent(int round, string actor, string[] targets, AbilityEffect abilityEffect, int effectMagnitude) { Round = round; Actor = actor; Targets = targets; AbilityEffect = abilityEffect; EffectMagnitude = effectMagnitude; }
public override void Die(AbilityEffect source) { base.Die(source); if (Game.instance.battle.AllMonstersDead) { GameManager.instance.PlanAction(Game.instance.battle.Win); } Player.instance.Experience += 1; }
//constructor with overload public AbilityBase(AbilityEffect _abil_effect, AbilityTarget _abil_target, AbilityAOE _abil_aoe, int _str, int _duration, int _delay) { Ability_effect = _abil_effect; Ability_target = _abil_target; Ability_aoe = _abil_aoe; strength = _str; duration = _duration; delay = _delay; }
public void PlayAnimation(AbilityEffect effect, UnitEntity caster, UnitEntity target) { var targets = caster.GetEntitiesInRange(100); foreach (var t in targets) { var beam = Object.Instantiate(effect, t.view.GameObject.transform, false).GetComponent <AbilityEffect>(); beam.PlayAnimation(); } }