Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Commit

Permalink
Replication (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
FurkanS1821 authored and moonshadow565 committed Jun 26, 2018
1 parent c6bfe84 commit f27b9d4
Show file tree
Hide file tree
Showing 31 changed files with 193 additions and 210 deletions.
14 changes: 7 additions & 7 deletions Buffs/LuluR/LuluR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ namespace LuluR
{
internal class LuluR : BuffGameScript
{
private ChampionStatModifier _statMod;
private StatsModifier _statMod;
private float _healthBefore;
private float _meantimeDamage;
private float _healthNow;
private float _healthBonus;

public void OnActivate(ObjAIBase unit, Spell ownerSpell)
{
_statMod = new ChampionStatModifier();
_statMod = new StatsModifier();
_statMod.Size.PercentBonus = _statMod.Size.PercentBonus + 1;
_healthBefore = unit.GetStats().CurrentHealth;
_healthBefore = unit.Stats.CurrentHealth;
_healthBonus = 150 + 150 * ownerSpell.Level;
_statMod.HealthPoints.BaseBonus = _statMod.HealthPoints.BaseBonus + 150 + 150 * ownerSpell.Level;
unit.GetStats().CurrentHealth = unit.GetStats().CurrentHealth + 150 + 150 * ownerSpell.Level;
unit.Stats.CurrentHealth = unit.Stats.CurrentHealth + 150 + 150 * ownerSpell.Level;
unit.AddStatModifier(_statMod);
}

public void OnDeactivate(ObjAIBase unit)
{
_healthNow = unit.GetStats().CurrentHealth - _healthBonus;
_healthNow = unit.Stats.CurrentHealth - _healthBonus;
_meantimeDamage = _healthBefore - _healthNow;
float bonusDamage = _healthBonus - _meantimeDamage;
unit.RemoveStatModifier(_statMod);
if (unit.GetStats().CurrentHealth > unit.GetStats().HealthPoints.Total)
if (unit.Stats.CurrentHealth > unit.Stats.HealthPoints.Total)
{
unit.GetStats().CurrentHealth = unit.GetStats().CurrentHealth - bonusDamage;
unit.Stats.CurrentHealth = unit.Stats.CurrentHealth - bonusDamage;
}
}

Expand Down
6 changes: 3 additions & 3 deletions Buffs/LuluWBuff/LuluWBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace LuluWBuff
{
internal class LuluWBuff : BuffGameScript
{
private ChampionStatModifier _statMod;
private StatsModifier _statMod;

public void OnActivate(ObjAIBase unit, Spell ownerSpell)
{
var ap = ownerSpell.Owner.GetStats().AbilityPower.Total * 0.001;
_statMod = new ChampionStatModifier();
var ap = ownerSpell.Owner.Stats.AbilityPower.Total * 0.001;
_statMod = new StatsModifier();
_statMod.MoveSpeed.PercentBonus = _statMod.MoveSpeed.PercentBonus + 0.3f + (float)ap;
unit.AddStatModifier(_statMod);
}
Expand Down
4 changes: 2 additions & 2 deletions Buffs/LuluWDebuff/LuluWDebuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ internal class LuluWDebuff : BuffGameScript
{
private UnitCrowdControl _crowdDisarm = new UnitCrowdControl(CrowdControlType.Disarm);
private UnitCrowdControl _crowdSilence = new UnitCrowdControl(CrowdControlType.Silence);
private ChampionStatModifier _statMod;
private StatsModifier _statMod;

public void OnActivate(ObjAIBase unit, Spell ownerSpell)
{
_statMod = new ChampionStatModifier();
_statMod = new StatsModifier();
_statMod.MoveSpeed.BaseBonus = _statMod.MoveSpeed.BaseBonus - 60;
unit.ApplyCrowdControl(_crowdDisarm);
unit.ApplyCrowdControl(_crowdSilence);
Expand Down
4 changes: 2 additions & 2 deletions Buffs/Overdrive/Overdrive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace Overdrive
{
internal class Overdrive : BuffGameScript
{
private ChampionStatModifier _statMod;
private StatsModifier _statMod;

public void OnActivate(ObjAIBase unit, Spell ownerSpell)
{
_statMod = new ChampionStatModifier();
_statMod = new StatsModifier();
_statMod.MoveSpeed.PercentBonus = _statMod.MoveSpeed.PercentBonus + (12f + ownerSpell.Level * 4) / 100f;
_statMod.AttackSpeed.PercentBonus = _statMod.AttackSpeed.PercentBonus + (22f + 8f * ownerSpell.Level) / 100f;
unit.AddStatModifier(_statMod);
Expand Down
4 changes: 2 additions & 2 deletions Buffs/OverdriveSlow/OverdriveSlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace OverdriveSlow
{
internal class OverdriveSlow : BuffGameScript
{
private ChampionStatModifier _statMod;
private StatsModifier _statMod;

public void OnActivate(ObjAIBase unit, Spell ownerSpell)
{
_statMod = new ChampionStatModifier();
_statMod = new StatsModifier();
_statMod.MoveSpeed.PercentBonus = _statMod.MoveSpeed.PercentBonus - 0.3f;
unit.AddStatModifier(_statMod);
}
Expand Down
3 changes: 1 addition & 2 deletions Buffs/Quickdraw/Quickdraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Quickdraw
{
internal class Quickdraw : BuffGameScript
{
private ChampionStatModifier _statMod = new ChampionStatModifier();
private StatsModifier _statMod = new StatsModifier();

public void OnUpdate(double diff)
{
Expand All @@ -24,4 +24,3 @@ public void OnDeactivate(ObjAIBase unit)
}
}
}

12 changes: 6 additions & 6 deletions Champions/Annie/Q.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)

public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
{
var ap = owner.GetStats().AbilityPower.Total * 0.8f;
var ap = owner.Stats.AbilityPower.Total * 0.8f;
var damage = 45 + spell.Level * 35 + ap;
if (target != null && !ApiFunctionManager.IsDead(target))
{
target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL,
false);
if (target.IsDead)
{
spell.LowerCooldown(0, spell.getCooldown());
spell.LowerCooldown(0, spell.GetCooldown());
float manaToRecover = 55 + spell.Level * 5;
var newMana = owner.GetStats().CurrentMana + manaToRecover;
var maxMana = owner.GetStats().ManaPoints.Total;
var newMana = owner.Stats.CurrentMana + manaToRecover;
var maxMana = owner.Stats.ManaPoints.Total;
if (newMana >= maxMana)
{
owner.GetStats().CurrentMana = maxMana;
owner.Stats.CurrentMana = maxMana;
}
else
{
owner.GetStats().CurrentMana = newMana;
owner.Stats.CurrentMana = newMana;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Champions/Blitzcrank/Q.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)

public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
{
var ap = owner.GetStats().AbilityPower.Total;
var ap = owner.Stats.AbilityPower.Total;
var damage = 25 + spell.Level * 55 + ap;
spell.Target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL,
false);
Expand Down
2 changes: 1 addition & 1 deletion Champions/Caitlyn/E.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)

public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
{
var ap = owner.GetStats().AbilityPower.Total * 0.8f;
var ap = owner.Stats.AbilityPower.Total * 0.8f;
var damage = 80 + (spell.Level - 1) * 50 + ap;
target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
var slowDuration = new[] {0, 1, 1.25f, 1.5f, 1.75f, 2}[spell.Level];
Expand Down
2 changes: 1 addition & 1 deletion Champions/Caitlyn/Q.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Pro
{
var reduc = Math.Min(projectile.ObjectsHit.Count, 5);
var baseDamage = new[] {20, 60, 100, 140, 180}[spell.Level - 1] +
1.3f * owner.GetStats().AttackDamage.Total;
1.3f * owner.Stats.AttackDamage.Total;
var damage = baseDamage * (1 - reduc / 10);
target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
}
Expand Down
2 changes: 1 addition & 1 deletion Champions/Caitlyn/R.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Pro
if (target != null && !target.IsDead)
{
// 250/475/700
var damage = 250 + owner.GetStats().AttackDamage.Total * 2;
var damage = 250 + owner.Stats.AttackDamage.Total * 2;
target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_SPELL,
false);
}
Expand Down
6 changes: 3 additions & 3 deletions Champions/Ezreal/E.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
ApiFunctionManager.AddParticleTarget(owner, "Ezreal_arcaneshift_flash.troy", owner);
AttackableUnit target2 = null;
var units = ApiFunctionManager.GetUnitsInRange(owner, 700, true);
float distance = 700;
foreach (var value in units)
{
float distance = 700;
if (owner.Team != value.Team)
if (owner.Team != value.Team && value is ObjAIBase)
{
if (Vector2.Distance(new Vector2(trueCoords.X, trueCoords.Y), new Vector2(value.X, value.Y)) <=
distance)
Expand All @@ -67,7 +67,7 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)

public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
{
target.TakeDamage(owner, 25f + spell.Level * 50f + owner.GetStats().AbilityPower.Total * 0.75f,
target.TakeDamage(owner, 25f + spell.Level * 50f + owner.Stats.AbilityPower.Total * 0.75f,
DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
projectile.setToRemove();
}
Expand Down
6 changes: 0 additions & 6 deletions Champions/Ezreal/Passive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ public class EzrealRisingSpellForce : GameScript
{
public void OnActivate(Champion owner)
{
ApiFunctionManager.LogInfo("Ezreal Passive OnActivate");
ApiEventManager.OnChampionDamageTaken.AddListener(this, owner, SelfWasDamaged);
}

private void SelfWasDamaged()
{
ApiFunctionManager.LogInfo("Ezreal was damaged");
}

public void OnDeactivate(Champion owner)
Expand Down
16 changes: 7 additions & 9 deletions Champions/Ezreal/Q.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ public void OnDeactivate(Champion owner)
public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
{
ApiFunctionManager.AddParticleTarget(owner, "ezreal_bow.troy", owner, 1, "L_HAND");
owner.AddBuffGameScript("Quickdraw", "Quickdraw", spell);
ApiFunctionManager.AddBuffHUDVisual("OlafBerzerkerRage", 6.0f, 0, owner);
ApiFunctionManager.AddBuffHUDVisual("Absolute_Zero", 6.0f, 0, owner);
}

public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
Expand All @@ -35,14 +32,15 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)

public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
{
var ad = owner.GetStats().AttackDamage.Total * 1.1f;
var ap = owner.GetStats().AbilityPower.Total * 0.4f;
var ad = owner.Stats.AttackDamage.Total * 1.1f;
var ap = owner.Stats.AbilityPower.Total * 0.4f;
var damage = 15 + spell.Level * 20 + ad + ap;
target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_ATTACK, false);
spell.LowerCooldown(0, 1);
spell.LowerCooldown(1, 1);
spell.LowerCooldown(2, 1);
spell.LowerCooldown(3, 1);
for (byte i = 0; i < 4; i++)
{
spell.LowerCooldown(i, 1);
}

projectile.setToRemove();
}

Expand Down
4 changes: 2 additions & 2 deletions Champions/Ezreal/R.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
{
var reduc = Math.Min(projectile.ObjectsHit.Count, 7);
var bonusAd = owner.GetStats().AttackDamage.Total - owner.GetStats().AttackDamage.BaseValue;
var ap = owner.GetStats().AbilityPower.Total * 0.9f;
var bonusAd = owner.Stats.AttackDamage.Total - owner.Stats.AttackDamage.BaseValue;
var ap = owner.Stats.AbilityPower.Total * 0.9f;
var damage = 200 + spell.Level * 150 + bonusAd + ap;
target.TakeDamage(owner, damage * (1 - reduc / 10), DamageType.DAMAGE_TYPE_MAGICAL,
DamageSource.DAMAGE_SOURCE_SPELL, false);
Expand Down
16 changes: 8 additions & 8 deletions Champions/Gangplank/Q.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)

public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
{
var isCrit = new Random().Next(0, 100) < owner.GetStats().CriticalChance.Total;
var baseDamage = new[] {20, 45, 70, 95, 120}[spell.Level - 1] + owner.GetStats().AttackDamage.Total;
var damage = isCrit ? baseDamage * owner.GetStats().getCritDamagePct() / 100 : baseDamage;
var isCrit = new Random().Next(0, 100) < owner.Stats.CriticalChance.Total;
var baseDamage = new[] {20, 45, 70, 95, 120}[spell.Level - 1] + owner.Stats.AttackDamage.Total;
var damage = isCrit ? baseDamage * owner.Stats.CriticalDamage.Total / 100 : baseDamage;
var goldIncome = new[] {4, 5, 6, 7, 8}[spell.Level - 1];
if (target != null && !target.IsDead)
{
target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_PHYSICAL, DamageSource.DAMAGE_SOURCE_ATTACK,
false);
if (target.IsDead)
{
owner.GetStats().Gold += goldIncome;
owner.Stats.Gold += goldIncome;
var manaCost = new float[] {50, 55, 60, 65, 70}[spell.Level - 1];
var newMana = owner.GetStats().CurrentMana + manaCost / 2;
var maxMana = owner.GetStats().ManaPoints.Total;
var newMana = owner.Stats.CurrentMana + manaCost / 2;
var maxMana = owner.Stats.ManaPoints.Total;
if (newMana >= maxMana)
{
owner.GetStats().CurrentMana = maxMana;
owner.Stats.CurrentMana = maxMana;
}
else
{
owner.GetStats().CurrentMana = newMana;
owner.Stats.CurrentMana = newMana;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Champions/Garen/E.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void ApplySpinDamage(Champion owner, Spell spell, AttackableUnit target)
if (unit.Team != owner.Team)
{
//PHYSICAL DAMAGE PER SECOND: 20 / 45 / 70 / 95 / 120 (+ 70 / 80 / 90 / 100 / 110% AD)
float ad = new[] {.7f, .8f, .9f, 1f, 1.1f}[spell.Level - 1] * owner.GetStats().AttackDamage.Total *
float ad = new[] {.7f, .8f, .9f, 1f, 1.1f}[spell.Level - 1] * owner.Stats.AttackDamage.Total *
0.5f;
float damage = new[] {20, 45, 70, 95, 120}[spell.Level - 1] * 0.5f + ad;
if (unit is Minion) damage *= 0.75f;
Expand Down
2 changes: 1 addition & 1 deletion Champions/Global/SummonerDot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
{
var visualBuff = ApiFunctionManager.AddBuffHUDVisual("SummonerDot", 5.0f, 1, (ObjAIBase) target);
Particle p = ApiFunctionManager.AddParticleTarget(owner, "Global_SS_Ignite.troy", target, 1);
var damage = 10 + owner.GetStats().Level * 4;
var damage = 10 + owner.Stats.Level * 4;
target.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_TRUE, DamageSource.DAMAGE_SOURCE_SPELL, false);
ApiFunctionManager.CreateTimer(1.0f,
() =>
Expand Down
2 changes: 1 addition & 1 deletion Champions/Global/SummonerExhaust.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
var ai = target as ObjAIBase;
if (ai != null)
{
ChampionStatModifier statMod = new ChampionStatModifier();
StatsModifier statMod = new StatsModifier();
statMod.MoveSpeed.PercentBonus -= 30.0f / 100.0f;
statMod.AttackSpeed.PercentBonus -= 30.0f / 100.0f;
statMod.Armor.BaseBonus -= 10;
Expand Down
2 changes: 1 addition & 1 deletion Champions/Global/SummonerHaste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class SummonerHaste : GameScript
{
public void OnStartCasting(Champion owner, Spell spell, AttackableUnit target)
{
ChampionStatModifier statMod = new ChampionStatModifier();
StatsModifier statMod = new StatsModifier();
statMod.MoveSpeed.PercentBonus = 27 / 100.0f;
owner.AddStatModifier(statMod);
var hasteBuff = ApiFunctionManager.AddBuffHUDVisual("SummonerHaste", 10.0f, 1, owner, 10.0f);
Expand Down
Loading

0 comments on commit f27b9d4

Please sign in to comment.