Advertisement
R30

ItB Punch Mech Weapon

R30
Dec 7th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.26 KB | None | 0 0
  1. Prime_Punchmech = Skill:new{  
  2.     Class = "Prime",
  3.     Icon = "weapons/prime_punchmech.png",
  4.     Rarity = 3,
  5.     Explosion = "",
  6.     LaunchSound = "/weapons/titan_fist",
  7.     Range = 1, -- Tooltip?
  8.     PathSize = 1,
  9.     Damage = 2,
  10.     PushBack = false,
  11.     Flip = false,
  12.     Dash = false,
  13.     Shield = false,
  14.     Projectile = false,
  15.     Push = 1, --Mostly for tooltip, but you could turn it off for some unknown reason
  16.     PowerCost = 1,
  17.     Upgrades = 2,
  18.     --UpgradeList = { "Dash",  "+2 Damage"  },
  19.     UpgradeCost = { 2 , 3 },
  20.     TipImage = StandardTips.Melee
  21. }
  22.                
  23. function Prime_Punchmech:GetSkillEffect(p1, p2)
  24.     local ret = SkillEffect()
  25.     local direction = GetDirection(p2 - p1)
  26.  
  27.     local doDamage = true
  28.     local target = GetProjectileEnd(p1,p2,PATH_PROJECTILE)
  29.     local push_damage = self.Flip and DIR_FLIP or direction
  30.     local damage = SpaceDamage(target, self.Damage, push_damage)
  31.     damage.sAnimation = "explopunch1_"..direction
  32.     if self.Flip then damage.sAnimation = "SwipeClaw2" end  -- Change the animation if it's a flip
  33.    
  34.     if self.Shield then
  35.         local shield = SpaceDamage(p1,0)
  36.         shield.iShield = EFFECT_CREATE
  37.         ret:AddDamage(shield)
  38.     end
  39.    
  40.     if self.Dash then
  41.        
  42.         if not Board:IsBlocked(target,PATH_PROJECTILE) then -- dont attack an empty edge square, just run to the edge
  43.             doDamage = false
  44.             target = target + DIR_VECTORS[direction]
  45.         end
  46.        
  47.         ret:AddCharge(Board:GetSimplePath(p1, target - DIR_VECTORS[direction]), FULL_DELAY)
  48.     elseif self.Projectile and target:Manhattan(p1) ~= 1 then
  49.         damage.loc = target
  50.         ret:AddDamage(SpaceDamage(p1,0,(direction+2)%4))
  51.         ret:AddProjectile(damage, "effects/shot_fist")
  52.         doDamage = false--damage covered here
  53.     else
  54.         target = p2
  55.     end
  56.  
  57.    
  58.     if doDamage then
  59.         damage.loc = target
  60.         ret:AddMelee(p2 - DIR_VECTORS[direction], damage)
  61.     end
  62.    
  63.     if self.PushBack then
  64.         ret:AddDamage(SpaceDamage(p1, 0, GetDirection(p1 - p2)))
  65.     end
  66.     return ret
  67. end
  68.  
  69. Prime_Punchmech_A = Prime_Punchmech:new{
  70.     PathSize = INT_MAX,
  71.     Dash = true,
  72.     TipImage = {
  73.         Unit = Point(2,4),
  74.         Enemy = Point(2,1),
  75.         Target = Point(2,1)
  76.     }
  77. }
  78.  
  79. Prime_Punchmech_B = Prime_Punchmech:new{   
  80.     Damage = 4,
  81. }
  82.  
  83. Prime_Punchmech_AB = Prime_Punchmech:new{
  84.     PathSize = INT_MAX,
  85.     Dash = true,
  86.     Damage = 4,
  87.     TipImage = Prime_Punchmech_A.TipImage
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement