Advertisement
Unkn0wn4all

monkey ace paragon

Aug 19th, 2022
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.70 KB | Gaming | 0 0
  1. namespace VanillaParagons.MilitaryParagons.MonkeyAceParagon
  2. {
  3.     public class MonkeyAceParagonBase : ModVanillaParagon
  4.     {
  5.         public override string BaseTower => "MonkeyAce-502"; // the base bahaviors I'll build off of, basically needed cuz I'm not coding in all that monkey ace flying stuff.
  6.     }
  7.     public class MonkeyAceParagon : ModParagonUpgrade<MonkeyAceParagonBase>
  8.     {
  9.         public override string DisplayName => "Rain of fire";
  10.         public override int Cost => 967000;
  11.         public override string Description => "why does this exist";
  12.         //public override string Icon => "";
  13.         //public override string Portrait => "";
  14.         public override void ApplyUpgrade(TowerModel tower) //modifying the behaviors, and btd mod helper supplies the parameter of TowerModel (makes the tower and adds a variable so I can edit the tower).
  15.         {
  16.             // created variables to use later, using the tower inserted into the tower parimeter.
  17.             var weapon = tower.GetWeapon();
  18.             var projectile = weapon.projectile;
  19.  
  20.             //projectile count.
  21.             weapon.emission = new ArcEmissionModel("MonkeyAceParagonArcEmissionModel", 128, 180, 360, null, false);
  22.             //damage.
  23.             projectile.AddBehavior(new DamageModifierForTagModel("DamageModifierForTagModel_Moabs", "Moabs", 1, 220, false, false));
  24.             projectile.GetDamageModel().damage += 160;
  25.             projectile.pierce = 50;
  26.             //seeking.
  27.             var seekingBehavior = new TrackTargetModel("MonkeyAceParagonTrackTargetModel", 9999999, true, false, 360, true, 700, false, false);
  28.             projectile.AddBehavior(seekingBehavior);
  29.  
  30.             //using the tower perimeter to get the missles, since the 5-0-2 already has them.
  31.             var missile = tower.GetBehaviors<AttackAirUnitModel>().First(a => a.name == "AttackAirUnitModel_Anti-MoabMissile_");
  32.  
  33.             //missle attack speed
  34.             missile.weapons[0].Rate *= 0.1f;
  35.             //missle damage
  36.             missile.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("DamageModifierForTagModel_Moabs", "Moabs", 1, 12500f, false, false));
  37.             missile.GetDescendants<DamageModel>().ForEach(damage => damage.damage = 1000.0f);
  38.             missile.GetDescendants<DamageModel>().ForEach(damage => damage.immuneBloonProperties = BloonProperties.None);
  39.  
  40.             //found pineapples from an existing tower and duplicating them into my tower.
  41.             tower.AddBehavior(Game.instance.model.GetTowerFromId("MonkeyAce-220").GetBehaviors<AttackAirUnitModel>()[1].Duplicate());
  42.             var pineapples = tower.GetBehaviors<AttackAirUnitModel>()[2];
  43.             //pineapple attack speed
  44.             pineapples.weapons[0].Rate *= 0.05f;
  45.             //pineapple damage
  46.             pineapples.GetDescendants<DamageModel>().ForEach(damage => damage.damage = 3500.0f);
  47.             pineapples.GetDescendants<DamageModel>().ForEach(damage => damage.immuneBloonProperties = BloonProperties.None);
  48.  
  49.             //found ability model from an existing tower and duplicating it into my tower, and also getting the activate attack model (a model containing attack models exclusive to when the ability is active).
  50.             var groundzeroAbility = Game.instance.model.GetTower(TowerType.MonkeyAce, 0, 5).GetAbility().Duplicate();
  51.             var goundzeroAbilityAttackModel = groundzeroAbility.GetBehavior<ActivateAttackModel>();
  52.  
  53.             //getting rid of the caps and changing the damage.
  54.             goundzeroAbilityAttackModel.GetDescendant<AttackAirUnitModel>().weapons[0].projectile.GetDamageModel().maxDamage = 999999;
  55.             goundzeroAbilityAttackModel.GetDescendant<AttackAirUnitModel>().weapons[0].projectile.GetDamageModel().CapDamage(999999);
  56.             goundzeroAbilityAttackModel.GetDescendant<AttackAirUnitModel>().weapons[0].projectile.GetDamageModel().damage = 250000;
  57.             //getting rid of the caps and changing the pierce.
  58.             goundzeroAbilityAttackModel.GetDescendant<AttackAirUnitModel>().weapons[0].projectile.maxPierce = 999999;
  59.             goundzeroAbilityAttackModel.GetDescendant<AttackAirUnitModel>().weapons[0].projectile.CapPierce(999999);
  60.             goundzeroAbilityAttackModel.GetDescendant<AttackAirUnitModel>().weapons[0].projectile.pierce = 250000;
  61.  
  62.             tower.AddBehavior(groundzeroAbility);
  63.  
  64.             //making the tower hit camo by removing the invisible filters in some of my projectiles, and making the tower see camo like the ninja.
  65.             tower.GetDescendants<FilterInvisibleModel>().ForEach(model => model.isActive = false);
  66.             tower.AddBehavior(new OverrideCamoDetectionModel("OverrideCamoDetectionModel_", true));
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement