Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.88 KB | None | 0 0
  1. addHook("ThinkFrame", do
  2.     for player in players.iterate
  3.         if player.mo and player.mo.skin == "duon"
  4.             player.powers[pw_underwater] = 1073741824
  5.         end
  6.     end
  7. end)
  8.  
  9. addHook("ThinkFrame", do
  10.     for player in players.iterate
  11.         if player.mo and player.mo.skin == "duon" then
  12.                         if not (player.pflags & PF_NIGHTSMODE)
  13.             and not (player.pflags & (PF_ROPEHANG|PF_CARRIED|PF_ITEMHANG|PF_MACESPIN))
  14.             and not (player.exiting)
  15.             and not (player.pflags & PF_SLIDING)
  16.             and not (player.pflags & PF_TIMEOVER)
  17.             and not (player.pflags & PF_JUMPED)
  18.             and not (player.pflags & PF_JUMPDOWN)
  19.             and not (player.mo.state == S_PLAY_DIE)
  20.             and not (player.mo.state == S_PLAY_PAIN)
  21.             and not (player.mo.state == S_PLAY_ATK1)
  22.             and not (player.mo.state == S_PLAY_ATK2)
  23.             and not (player.mo.state == S_PLAY_ATK3)
  24.             and not (player.mo.state == S_PLAY_ATK4)
  25.             and not (player.mo.state == S_PLAY_FALL1)
  26.             and not (player.mo.state == S_PLAY_FALL2)
  27.             and not (player.cmd.buttons & BT_USE)
  28.             and not (player.weapondelay)
  29.             and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
  30.                         and not P_IsObjectOnGround(player.mo)
  31.             and not player.climbing
  32.             and not (player.mo.state == S_PLAY_ABL1)
  33.             and not (player.mo.state == S_PLAY_ABL2)
  34.             and not (player.mo.state == S_PLAY_SPC1)
  35.             and not (player.mo.state == S_PLAY_SPC2)
  36.             and not (player.mo.state == S_PLAY_SPC3)
  37.             and not (player.mo.state == S_PLAY_SPC4)
  38.                 player.mo.state = S_PLAY_ATK1
  39.                 player.pflags = $1|PF_JUMPED
  40.             end
  41.         end
  42.     end
  43. end)
  44.  
  45. addHook("MobjSpawn", function(mo) mo.duonhp = 4 end, MT_PLAYER)
  46.  
  47. addHook("ThinkFrame", do
  48.     for player in players.iterate
  49.         if player.mo and player.mo.skin == "duon" then
  50.  
  51.             if (player.mo.duonhp < 1) and (player.health)
  52.                 player.health = 0
  53.                 P_KillMobj(player.mo)
  54.             end
  55.             if (player.exdelay == nil)
  56.                 player.exdelay = 0
  57.             end
  58.             if not (player.health) and not (player.exdelay == 0)
  59.                 player.exdelay = $1 - 1
  60.             end
  61.             if not (player.health) and (player.exdelay == 0)
  62.                 player.exdelay = 5
  63.             end
  64.         end
  65.     end
  66. end)
  67.  
  68. addHook("MobjDamage", function(target, inflictor, source, damage)
  69.     if (target and target.skin == "duon") and not (target.player.powers[pw_super])
  70.         S_StartSound(target, sfx_altdi1)
  71.         target.player.powers[pw_flashing] = TICRATE*3
  72.         target.player.mo.state = S_PLAY_PAIN
  73.         P_SetObjectMomZ(target, FRACUNIT*6, false)
  74.         P_InstaThrust(target, target.angle, -10*FRACUNIT)
  75.         if not target.player.powers[pw_shield]
  76.             P_PlayerWeaponPanelBurst(target.player)
  77.             P_PlayerWeaponAmmoBurst(target.player)
  78.             P_PlayerEmeraldBurst(target.player, false)
  79.             P_PlayerFlagBurst(target.player)
  80.             target.player.mo.duonhp = $1 - 1
  81.         end
  82.         if (target.player.powers[pw_shield] == SH_ELEMENTAL) and (target.player.mo.eflags & MFE_UNDERWATER)
  83.             target.player.powers[pw_underwater] = 1050
  84.             end
  85.         P_RemoveShield(target.player)
  86.         return true
  87.     else
  88.         return nil
  89.         end
  90. end, MT_PLAYER)
  91.  
  92. local function duonhpbar(v, player)
  93.     if player.mo and player.mo.skin == "duon"
  94.     and not (player.pflags & PF_NIGHTSMODE)
  95.         if player.mo.duonhp == 4
  96.             v.draw(230, 42, v.cachePatch("LIFE1"))
  97.         elseif player.mo.duonhp == 3
  98.             v.draw(230, 42, v.cachePatch("LIFE2"))
  99.         elseif player.mo.duonhp == 2
  100.             v.draw(230, 42, v.cachePatch("LIFE3"))
  101.         elseif player.mo.duonhp == 1
  102.             v.draw(230, 42, v.cachePatch("LIFE4"))
  103.         elseif player.mo.duonhp == 0
  104.             v.draw(230, 42, v.cachePatch("LIFE5"))
  105.         end
  106.     end
  107. end
  108. hud.add(duonhpbar)
  109.  
  110. function A_INVERTDUONDIR(actor, var1, var2)
  111.     for player in players.iterate
  112.         player.mo.angle = FixedAngle(AngleFixed(InvAngle(player.mo.angle))*2)
  113.     end
  114. end
  115.    
  116.  
  117. function A_SPAWNWJOBJECT(actor, var1, var2)
  118.     local springtype
  119.     if not (actor.target and actor.target.player)
  120.         return
  121.     end
  122.     if actor.target.player.powers[pw_super]
  123.         springtype = var2
  124.     else
  125.         springtype = var1
  126.     end
  127.    
  128.     P_InstaThrust(actor.target.player.mo, actor.target.player.mo.angle, -25*FRACUNIT)
  129.     actor.target.player.mo.angle = R_PointToAngle2(0, 0, actor.target.player.mo.momx, actor.target.player.mo.momy)
  130.     P_InstaThrust(actor.target.player.mo, actor.target.player.mo.angle, 25*FRACUNIT)
  131.     if actor.target.player.powers[pw_super]
  132.         P_SetObjectMomZ(actor.target.player.mo, actor.target.player.jumpfactor*20, false)
  133.     else
  134.         P_SetObjectMomZ(actor.target.player.mo, actor.target.player.jumpfactor*15, false)
  135.     end
  136.     actor.target.player.pflags = $1 & ~PF_THOKKED
  137.     actor.target.player.mo.countdown = 0
  138. end
  139.  
  140. //The Walljump Process.
  141.  
  142. addHook("ThinkFrame", do
  143.     for player in players.iterate
  144.         if not (player.mo and player.mo.skin == "duon")
  145.             continue
  146.         end
  147.        
  148.             if not (player.pflags & PF_NIGHTSMODE) //don't mess with nights man
  149.                
  150.                 if not player.mo.countdown
  151.                     player.mo.countdown = TICRATE
  152.                 end
  153.                 player.mo.countdown = $1 + 1
  154.                
  155.                
  156.                 if player.mo.countdown > TICRATE/4
  157.                 and player.mo.countdown < TICRATE/2
  158.                     P_InstaThrust(player.mo, player.mo.angle, 25*FRACUNIT)
  159.                     player.mo.countdown = TICRATE/8
  160.                 end
  161.             end
  162.         end
  163.     end)
  164.  
  165.  
  166. addHook("ThinkFrame", do
  167.     for player in players.iterate
  168.         if (player.mo and player.mo.skin == "duon")
  169.             if not (player.cmd.buttons & BT_USE)
  170.                 player.mo.usedown = 0
  171.             end
  172.             if player.cmd.buttons & BT_USE
  173.             and player.mo.usedown == 0
  174.                 P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_PHWJ)
  175.                 player.mo.usedown = 1
  176.             end
  177.         end
  178.     end
  179. end)
  180.  
  181. addHook("MobjSpawn", function(mo) mo.boost = 0 end, MT_PLAYER)
  182. addHook("MobjSpawn", function(mo) mo.boosting = 0 end, MT_PLAYER)
  183.  
  184. addHook("ThinkFrame", do
  185.     for player in players.iterate
  186.         if (player.mo and player.mo.skin == "duon")
  187.             if (player.cmd.buttons & BT_CUSTOM1)
  188.                 if not (player.pflags & PF_NIGHTSMODE)
  189.                 and not (player.pflags & PF_CARRIED)
  190.                 and not (player.pflags & PF_ROPEHANG)
  191.                 and not (player.pflags & PF_MACESPIN)
  192.                 and not (player.pflags & PF_TAGGED)
  193.                 and not (player.pflags & PF_STASIS)
  194.                 and not player.exiting
  195.                 player.boost = 0
  196.                     if player.health > 1
  197.                     and player.mo.health > 1
  198.                         if player.mo.boosting == 0
  199.                             player.mo.boosting = 1
  200.                         end
  201.                         player.mo.boost = $1 + 1
  202.                         player.mo.flags = ($1) & ~(MF_SHOOTABLE|MF_SOLID)
  203.                        
  204.                         if not (player.weapondelay)
  205.                             P_RadiusAttack(player.mo, player.mo, 150*FRACUNIT)
  206.                             player.weapondelay = TICRATE/8
  207.                         end
  208.                                                if player.speed < 50*FRACUNIT
  209.                             P_Thrust(player.mo, player.mo.angle, 5*FRACUNIT)
  210.                         end
  211.                         if player.speed >= 50*FRACUNIT
  212.                             P_InstaThrust(player.mo, player.mo.angle, 65*FRACUNIT)
  213.                             P_SpawnGhostMobj(player.mo)
  214.                         end
  215.                                                if player.mo.state == S_PLAY_STND
  216.                                                or player.mo.state == S_PLAY_TAP1
  217.                                                or player.mo.state == S_PLAY_TAP2
  218.                                                or player.mo.state == S_PLAY_RUN1
  219.                                                or player.mo.state == S_PLAY_RUN2
  220.                                                or player.mo.state == S_PLAY_RUN3
  221.                                                or player.mo.state == S_PLAY_RUN4
  222.                                                or player.mo.state == S_PLAY_RUN5
  223.                                                or player.mo.state == S_PLAY_RUN6
  224.                                                or player.mo.state == S_PLAY_RUN7
  225.                                                or player.mo.state == S_PLAY_RUN8
  226.                                                        player.mo.state = S_PLAY_SPD1
  227.                                                end
  228.                                 end
  229.                     if player.mo.boost == TICRATE/3
  230.                         player.health = $1 -1
  231.                         player.mo.health = $1 -1
  232.                         player.mo.boost = 0
  233.                     end
  234.                 end
  235.             end
  236.             if not (player.cmd.buttons & BT_CUSTOM1)
  237.                 player.mo.flags = ($1|MF_SOLID|MF_SHOOTABLE)
  238.                 player.mo.boosting = 0
  239.             end
  240.                        if not (player.cmd.buttons & BT_CUSTOM1)
  241.                        and (player.mo.boosting == 0)
  242.  
  243.                        end
  244.                     end
  245.                 end
  246.             end)
  247.  
  248.  
  249.  
  250. //super flash
  251. addHook("ThinkFrame", do
  252.     for player in players.iterate
  253.         if player.mo and player.mo.skin == "duon"
  254.            
  255.             if not player.mo.superflashcolor
  256.                 player.mo.superflashcolor = 0
  257.             end
  258.            
  259.             player.mo.superflashcolor = $1+1
  260.            
  261.             if player.mo.superflashcolor > 18
  262.                 player.mo.superflashcolor = 0
  263.             end
  264.  
  265.             if player.powers[pw_super]
  266.                 if player.mo.superflashcolor < 4
  267.                 or player.mo.superflashcolor == 22
  268.                     player.mo.color = SKINCOLOR_YELLOW
  269.                 end
  270.                 if player.mo.superflashcolor > 3
  271.                 and player.mo.superflashcolor < 7
  272.                     player.mo.color = SKINCOLOR_GOLD
  273.                 end
  274.                 if player.mo.superflashcolor > 6
  275.                 and player.mo.superflashcolor < 10
  276.                     player.mo.color = SKINCOLOR_ROSEWOOD
  277.                 end
  278.                 if player.mo.superflashcolor > 9
  279.                 and player.mo.superflashcolor < 13
  280.                     player.mo.color = SKINCOLOR_ORANGE
  281.                 end
  282.                 if player.mo.superflashcolor > 12
  283.                 and player.mo.superflashcolor < 16
  284.                     player.mo.color = SKINCOLOR_ROSEWOOD
  285.                 end
  286.                 if player.mo.superflashcolor > 15
  287.                 and player.mo.superflashcolor < 19
  288.                     player.mo.color = SKINCOLOR_GOLD
  289.                 end
  290.             end
  291.         end
  292.     end
  293. end)
  294.  
  295. addHook("MobjThinker", function(char)
  296.    if (char.skin == "duon")
  297.    and not (char.player.charflags & SF_SUPER)
  298.        char.player.charflags = $1|SF_SUPER
  299.    end
  300. end, MT_PLAYER)
  301.  
  302. addHook("ThinkFrame", do
  303.     for player in players.iterate
  304.         if player.mo and player.mo.skin == "duon"
  305.             if player.mo.regainhp == nil
  306.             player.mo.regainhp = 0
  307.             end        
  308.         end
  309.     end
  310. end)
  311.        
  312. addHook("TouchSpecial", regainhp, MT_RING)
  313.     for player in players.iterate
  314.         if player.mo and player.mo.skin == "duon"
  315.             if player.mo.health %5 == 1
  316.             and player.mo.duonhp < 4
  317.                 player.mo.duonhp = $1+1
  318.                 end
  319.             end
  320.         end
  321.     end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement