Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addHook("ThinkFrame", do
- for player in players.iterate
- if player.mo and player.mo.skin == "duon"
- player.powers[pw_underwater] = 1073741824
- end
- end
- end)
- addHook("ThinkFrame", do
- for player in players.iterate
- if player.mo and player.mo.skin == "duon" then
- if not (player.pflags & PF_NIGHTSMODE)
- and not (player.pflags & (PF_ROPEHANG|PF_CARRIED|PF_ITEMHANG|PF_MACESPIN))
- and not (player.exiting)
- and not (player.pflags & PF_SLIDING)
- and not (player.pflags & PF_TIMEOVER)
- and not (player.pflags & PF_JUMPED)
- and not (player.pflags & PF_JUMPDOWN)
- and not (player.mo.state == S_PLAY_DIE)
- and not (player.mo.state == S_PLAY_PAIN)
- and not (player.mo.state == S_PLAY_ATK1)
- and not (player.mo.state == S_PLAY_ATK2)
- and not (player.mo.state == S_PLAY_ATK3)
- and not (player.mo.state == S_PLAY_ATK4)
- and not (player.mo.state == S_PLAY_FALL1)
- and not (player.mo.state == S_PLAY_FALL2)
- and not (player.cmd.buttons & BT_USE)
- and not (player.weapondelay)
- and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
- and not P_IsObjectOnGround(player.mo)
- and not player.climbing
- and not (player.mo.state == S_PLAY_ABL1)
- and not (player.mo.state == S_PLAY_ABL2)
- and not (player.mo.state == S_PLAY_SPC1)
- and not (player.mo.state == S_PLAY_SPC2)
- and not (player.mo.state == S_PLAY_SPC3)
- and not (player.mo.state == S_PLAY_SPC4)
- player.mo.state = S_PLAY_ATK1
- player.pflags = $1|PF_JUMPED
- end
- end
- end
- end)
- addHook("MobjSpawn", function(mo) mo.duonhp = 4 end, MT_PLAYER)
- addHook("ThinkFrame", do
- for player in players.iterate
- if player.mo and player.mo.skin == "duon" then
- if (player.mo.duonhp < 1) and (player.health)
- player.health = 0
- P_KillMobj(player.mo)
- end
- if (player.exdelay == nil)
- player.exdelay = 0
- end
- if not (player.health) and not (player.exdelay == 0)
- player.exdelay = $1 - 1
- end
- if not (player.health) and (player.exdelay == 0)
- player.exdelay = 5
- end
- end
- end
- end)
- addHook("MobjDamage", function(target, inflictor, source, damage)
- if (target and target.skin == "duon") and not (target.player.powers[pw_super])
- S_StartSound(target, sfx_altdi1)
- target.player.powers[pw_flashing] = TICRATE*3
- target.player.mo.state = S_PLAY_PAIN
- P_SetObjectMomZ(target, FRACUNIT*6, false)
- P_InstaThrust(target, target.angle, -10*FRACUNIT)
- if not target.player.powers[pw_shield]
- P_PlayerWeaponPanelBurst(target.player)
- P_PlayerWeaponAmmoBurst(target.player)
- P_PlayerEmeraldBurst(target.player, false)
- P_PlayerFlagBurst(target.player)
- target.player.mo.duonhp = $1 - 1
- end
- if (target.player.powers[pw_shield] == SH_ELEMENTAL) and (target.player.mo.eflags & MFE_UNDERWATER)
- target.player.powers[pw_underwater] = 1050
- end
- P_RemoveShield(target.player)
- return true
- else
- return nil
- end
- end, MT_PLAYER)
- local function duonhpbar(v, player)
- if player.mo and player.mo.skin == "duon"
- and not (player.pflags & PF_NIGHTSMODE)
- if player.mo.duonhp == 4
- v.draw(230, 42, v.cachePatch("LIFE1"))
- elseif player.mo.duonhp == 3
- v.draw(230, 42, v.cachePatch("LIFE2"))
- elseif player.mo.duonhp == 2
- v.draw(230, 42, v.cachePatch("LIFE3"))
- elseif player.mo.duonhp == 1
- v.draw(230, 42, v.cachePatch("LIFE4"))
- elseif player.mo.duonhp == 0
- v.draw(230, 42, v.cachePatch("LIFE5"))
- end
- end
- end
- hud.add(duonhpbar)
- function A_INVERTDUONDIR(actor, var1, var2)
- for player in players.iterate
- player.mo.angle = FixedAngle(AngleFixed(InvAngle(player.mo.angle))*2)
- end
- end
- function A_SPAWNWJOBJECT(actor, var1, var2)
- local springtype
- if not (actor.target and actor.target.player)
- return
- end
- if actor.target.player.powers[pw_super]
- springtype = var2
- else
- springtype = var1
- end
- P_InstaThrust(actor.target.player.mo, actor.target.player.mo.angle, -25*FRACUNIT)
- actor.target.player.mo.angle = R_PointToAngle2(0, 0, actor.target.player.mo.momx, actor.target.player.mo.momy)
- P_InstaThrust(actor.target.player.mo, actor.target.player.mo.angle, 25*FRACUNIT)
- if actor.target.player.powers[pw_super]
- P_SetObjectMomZ(actor.target.player.mo, actor.target.player.jumpfactor*20, false)
- else
- P_SetObjectMomZ(actor.target.player.mo, actor.target.player.jumpfactor*15, false)
- end
- actor.target.player.pflags = $1 & ~PF_THOKKED
- actor.target.player.mo.countdown = 0
- end
- //The Walljump Process.
- addHook("ThinkFrame", do
- for player in players.iterate
- if not (player.mo and player.mo.skin == "duon")
- continue
- end
- if not (player.pflags & PF_NIGHTSMODE) //don't mess with nights man
- if not player.mo.countdown
- player.mo.countdown = TICRATE
- end
- player.mo.countdown = $1 + 1
- if player.mo.countdown > TICRATE/4
- and player.mo.countdown < TICRATE/2
- P_InstaThrust(player.mo, player.mo.angle, 25*FRACUNIT)
- player.mo.countdown = TICRATE/8
- end
- end
- end
- end)
- addHook("ThinkFrame", do
- for player in players.iterate
- if (player.mo and player.mo.skin == "duon")
- if not (player.cmd.buttons & BT_USE)
- player.mo.usedown = 0
- end
- if player.cmd.buttons & BT_USE
- and player.mo.usedown == 0
- P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_PHWJ)
- player.mo.usedown = 1
- end
- end
- end
- end)
- addHook("MobjSpawn", function(mo) mo.boost = 0 end, MT_PLAYER)
- addHook("MobjSpawn", function(mo) mo.boosting = 0 end, MT_PLAYER)
- addHook("ThinkFrame", do
- for player in players.iterate
- if (player.mo and player.mo.skin == "duon")
- if (player.cmd.buttons & BT_CUSTOM1)
- if not (player.pflags & PF_NIGHTSMODE)
- and not (player.pflags & PF_CARRIED)
- and not (player.pflags & PF_ROPEHANG)
- and not (player.pflags & PF_MACESPIN)
- and not (player.pflags & PF_TAGGED)
- and not (player.pflags & PF_STASIS)
- and not player.exiting
- player.boost = 0
- if player.health > 1
- and player.mo.health > 1
- if player.mo.boosting == 0
- player.mo.boosting = 1
- end
- player.mo.boost = $1 + 1
- player.mo.flags = ($1) & ~(MF_SHOOTABLE|MF_SOLID)
- if not (player.weapondelay)
- P_RadiusAttack(player.mo, player.mo, 150*FRACUNIT)
- player.weapondelay = TICRATE/8
- end
- if player.speed < 50*FRACUNIT
- P_Thrust(player.mo, player.mo.angle, 5*FRACUNIT)
- end
- if player.speed >= 50*FRACUNIT
- P_InstaThrust(player.mo, player.mo.angle, 65*FRACUNIT)
- P_SpawnGhostMobj(player.mo)
- end
- if player.mo.state == S_PLAY_STND
- or player.mo.state == S_PLAY_TAP1
- or player.mo.state == S_PLAY_TAP2
- or player.mo.state == S_PLAY_RUN1
- or player.mo.state == S_PLAY_RUN2
- or player.mo.state == S_PLAY_RUN3
- or player.mo.state == S_PLAY_RUN4
- or player.mo.state == S_PLAY_RUN5
- or player.mo.state == S_PLAY_RUN6
- or player.mo.state == S_PLAY_RUN7
- or player.mo.state == S_PLAY_RUN8
- player.mo.state = S_PLAY_SPD1
- end
- end
- if player.mo.boost == TICRATE/3
- player.health = $1 -1
- player.mo.health = $1 -1
- player.mo.boost = 0
- end
- end
- end
- if not (player.cmd.buttons & BT_CUSTOM1)
- player.mo.flags = ($1|MF_SOLID|MF_SHOOTABLE)
- player.mo.boosting = 0
- end
- if not (player.cmd.buttons & BT_CUSTOM1)
- and (player.mo.boosting == 0)
- end
- end
- end
- end)
- //super flash
- addHook("ThinkFrame", do
- for player in players.iterate
- if player.mo and player.mo.skin == "duon"
- if not player.mo.superflashcolor
- player.mo.superflashcolor = 0
- end
- player.mo.superflashcolor = $1+1
- if player.mo.superflashcolor > 18
- player.mo.superflashcolor = 0
- end
- if player.powers[pw_super]
- if player.mo.superflashcolor < 4
- or player.mo.superflashcolor == 22
- player.mo.color = SKINCOLOR_YELLOW
- end
- if player.mo.superflashcolor > 3
- and player.mo.superflashcolor < 7
- player.mo.color = SKINCOLOR_GOLD
- end
- if player.mo.superflashcolor > 6
- and player.mo.superflashcolor < 10
- player.mo.color = SKINCOLOR_ROSEWOOD
- end
- if player.mo.superflashcolor > 9
- and player.mo.superflashcolor < 13
- player.mo.color = SKINCOLOR_ORANGE
- end
- if player.mo.superflashcolor > 12
- and player.mo.superflashcolor < 16
- player.mo.color = SKINCOLOR_ROSEWOOD
- end
- if player.mo.superflashcolor > 15
- and player.mo.superflashcolor < 19
- player.mo.color = SKINCOLOR_GOLD
- end
- end
- end
- end
- end)
- addHook("MobjThinker", function(char)
- if (char.skin == "duon")
- and not (char.player.charflags & SF_SUPER)
- char.player.charflags = $1|SF_SUPER
- end
- end, MT_PLAYER)
- addHook("ThinkFrame", do
- for player in players.iterate
- if player.mo and player.mo.skin == "duon"
- if player.mo.regainhp == nil
- player.mo.regainhp = 0
- end
- end
- end
- end)
- addHook("TouchSpecial", regainhp, MT_RING)
- for player in players.iterate
- if player.mo and player.mo.skin == "duon"
- if player.mo.health %5 == 1
- and player.mo.duonhp < 4
- player.mo.duonhp = $1+1
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement