October 14, 2025, 08:19:43 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: [1] 2

Author Topic: [Server-sent Plugin] Buff Pyro  (Read 5321 times)

Derpduck

  • 2011 Haxxy Finalist
  • *
  • Karma: 42
  • Offline Offline
  • Posts: 5752
[Server-sent Plugin] Buff Pyro
« on: November 02, 2013, 05:42:41 am »

Makes pyro somewhat weaker than he was during 2.4 but much better than he is now.

Code: [Select]
//buffPyro
//Derpduck
object_event_clear(Flamethrower,ev_create,0)
object_event_add(Flamethrower,ev_create,0,'
{
    xoffset = -11;
    yoffset = 4;
    refireTime = 1;
    event_inherited();
   
    blastDistance = 150;
    blastAngle = 75;
    blastStrength = 28;
    characterBlastStrength = 15;
    blastNoFlameTime = 15;
    blastReloadTime = 40;
    flareReloadTime = 30;
    alarm[1] = blastReloadTime;
    alarm[2] = flareReloadTime;
    readyToBlast = false;
    readyToFlare = false;
    justBlast = false;
   
    maxAmmo = 200;
    ammoCount = maxAmmo;
    soundLoopTime = 30;
    currentTime = 0;
   
    reloadBuffer = 7;
    isRefilling = false;
   
    if(golden)
    {
        normalSprite = FlamethrowerGoldS;
        recoilSprite = FlamethrowerGoldFS;
        blastSprite = FlamethrowerGoldBlastS;
        dropSprite = FlamethrowerGoldDropS;
    }
    else
    {
        normalSprite = FlamethrowerS;
        recoilSprite = FlamethrowerFS;
        blastSprite = FlamethrowerBlastS;
        dropSprite = FlamethrowerDropS;
    }
    sprite_index = normalSprite;
   
    if variable_global_exists("global.recoilAnimations"){ //DSM
        if global.recoilAnimations==1{
            //play at least 2 frames
            recoilTime = 3;
            recoilAnimLength = sprite_get_number(recoilSprite)/2;
            recoilImageSpeed = recoilAnimLength/recoilTime;
   
            blastAnimLength = sprite_get_number(blastSprite)/2;
            blastImageSpeed = blastAnimLength/blastNoFlameTime;

            dropTime = 4;
            dropAnimLength = sprite_get_number(dropSprite)/2;
            dropImageSpeed = dropAnimLength/dropTime;
        }
    }else{
            //play at least 2 frames
            recoilTime = 3;
            recoilAnimLength = sprite_get_number(recoilSprite)/2;
            recoilImageSpeed = recoilAnimLength/recoilTime;
   
            blastAnimLength = sprite_get_number(blastSprite)/2;
            blastImageSpeed = blastAnimLength/blastNoFlameTime;

            dropTime = 4;
            dropAnimLength = sprite_get_number(dropSprite)/2;
            dropImageSpeed = dropAnimLength/dropTime;
    }
}
')

object_event_clear(Flamethrower,ev_step_begin,0)
object_event_add(Flamethrower,ev_step_begin,0,'
if (ammoCount < 0)
    ammoCount = 0;
else if (ammoCount <= maxAmmo and isRefilling)
    ammoCount += 2;
')

object_event_clear(Flamethrower,ev_user1,0)
object_event_add(Flamethrower,ev_user1,0,'
{
    if (readyToShoot and ammoCount >= 2
        and (!collision_line(x,y,x+lengthdir_x(25,owner.aimDirection),y+lengthdir_y(25,owner.aimDirection),Obstacle,1,0)
         and !place_meeting(x+lengthdir_x(25,owner.aimDirection),y+lengthdir_y(25,owner.aimDirection),TeamGate)
         or global.mapchanging))
    {
        if(alarm[3] <= 0)
            loopsoundstart(x,y,FlamethrowerSnd);
        else
            loopsoundmaintain(x,y,FlamethrowerSnd);
        alarm[3] = 2;
       
        var shot;
        randomize();
        shot = instance_create(x+lengthdir_x(25,owner.aimDirection),y+lengthdir_y(25,owner.aimDirection),Flame);
        shot.direction=owner.aimDirection+(random(10)-5);
        shot.speed=5+random(5);
        shot.owner=owner;
        shot.ownerPlayer=ownerPlayer;
        shot.team=owner.team;
        shot.weapon=WEAPON_FLAMETHROWER;
        with(shot)
            motion_add(owner.direction, owner.speed);
       
        justShot=true;
        readyToShoot=false;
        alarm[5] = reloadBuffer;
        isRefilling = false;
        ammoCount -= 2;
        if (ammoCount > 0)
            alarm[0]=refireTime;
        else
            alarm[0]=reloadBuffer*2;
    }
}
')

object_event_clear(Flamethrower,ev_user2,0)
object_event_add(Flamethrower,ev_user2,0,'
{
    if (readyToBlast && ammoCount >= 40)
    {
        //Base
        playsound(x,y,CompressionBlastSnd);
        poof = instance_create(x+lengthdir_x(25,owner.aimDirection),y+lengthdir_y(25,owner.aimDirection),AirBlastO);
        if image_xscale == 1
        {
            poof.image_xscale = 1;
            poof.image_angle = owner.aimDirection;
        }
        else
        {
            poof.image_xscale = -1;
            poof.image_angle = owner.aimDirection+180;
        }
        poof.owner = owner;
        with(poof)
            motion_add(owner.direction, owner.speed);
       
        var shot;
        //Flare
        if (owner.keyState & $10 and ammoCount >= 50 and readyToFlare)
        {
            if !collision_line(x,y,x+lengthdir_x(28,owner.aimDirection),y+lengthdir_y(28,owner.aimDirection),Obstacle,1,0)
                and !place_meeting(x+lengthdir_x(25,owner.aimDirection),y+lengthdir_y(25,owner.aimDirection),TeamGate)
            {
                shot = instance_create(x+lengthdir_x(25,owner.aimDirection),y+lengthdir_y(25,owner.aimDirection),Flare);
                shot.direction=owner.aimDirection;
                shot.speed=15;
                shot.owner=owner;
                shot.ownerPlayer=ownerPlayer;
                shot.team=owner.team;
                shot.weapon=WEAPON_FLARE;
               
                justShot=true;
                readyToFlare=false;
                ammoCount -= 10;
                alarm[2] = flareReloadTime;
            }
        }
           
        //Reflects
        with(Rocket)
        {
            if(ownerPlayer.team != other.owner.team)
            {
                dir = point_direction(other.x, other.y, x, y);
                dist = point_distance(other.x, other.y, x, y);
                angle = abs((dir-other.owner.aimDirection)+720) mod 360;
                if collision_circle(x,y,5,other.poof,false,true)
                {
                    ownerPlayer = other.ownerPlayer;
                    team = other.owner.team;
                    weapon = WEAPON_REFLECTED_ROCKET;
                    hitDamage = 25;
                    explosionDamage = 30;
                    knockback = 8;
                    alarm[0] = 200;
                    alarm[1] = 40;
                    alarm[2] = 80;
                    motion_set(other.owner.aimDirection, speed);
                }
            }
        }
        with(Flare)
        {
            if(ownerPlayer.team != other.owner.team)
            {
                dir = point_direction(other.x, other.y, x, y);
                dist = point_distance(other.x, other.y, x, y);
                angle = abs((dir-other.owner.aimDirection)+720) mod 360;
                if collision_circle(x,y,5,other.poof,false,true)
                {
                    ownerPlayer = other.ownerPlayer;
                    team = other.owner.team;
                    weapon = WEAPON_REFLECTED_FLARE;
                    alarm[0]=40;
                   
                    motion_set(other.owner.aimDirection, speed);
                }
            }
        }
       
        with(Mine)
        {
            if(ownerPlayer.team != other.owner.team)
            {
                dir = point_direction(other.x, other.y, x, y);
                dist = point_distance(other.x, other.y, x, y);
                angle = abs((dir-other.owner.aimDirection)+720) mod 360;
                if collision_circle(x,y,5,other.poof,false,true)
                {
                    motion_set(other.owner.aimDirection, max(speed, other.blastStrength / 3));
                    reflector = other.ownerPlayer;
                    if (stickied)
                    {
                        var dx, dy, l;
                        speed *= 0.65;
                        dy = (place_meeting(x,y-3,Obstacle) > 0);
                        dy -= (place_meeting(x,y+3,Obstacle) > 0);
                        dx = (place_meeting(x-3,y,Obstacle) > 0);
                        dx -= (place_meeting(x+3,y,Obstacle) > 0);
                        l = sqrt(dx*dx+dy*dy);
                        if(l>0)
                        {
                            var normalspeed;
                            dx /= l;
                            dy /= l;
                            normalspeed = dx*hspeed + dy*vspeed;
                            if(normalspeed < 0)
                            {
                                hspeed -= 2*normalspeed*dx;
                                vspeed -= 2*normalspeed*dy;
                            }
                        }
                        stickied = false;
                    }
                }
            }
        }
       
        //Shoves
        with(Character)
        {
                dir = point_direction(other.x, other.y, x, y);
                dist = point_distance(other.x, other.y, x, y);
                angle = abs((dir-other.owner.aimDirection)+720) mod 360;
                if collision_circle(x,y,25,other.poof,false,true) {
                    if(team != other.owner.team)
                    {
                        motion_add(other.owner.aimDirection, other.characterBlastStrength*(1-dist/other.blastDistance));
                        vspeed -= 2;
                        moveStatus = 3;
                        if (lastDamageDealer != other.ownerPlayer && lastDamageDealer != player)
                        {
                            secondToLastDamageDealer = lastDamageDealer;
                            alarm[4] = alarm[3];
                        }
                        alarm[3] = ASSIST_TIME;
                        lastDamageDealer = other.ownerPlayer;
                        lastDamageSource = -1;
                    }
                    else if (burnIntensity > 0 || burnDuration > 0)
                    {
                        burnIntensity = 0;
                        burnDuration = 0;
                        burnedBy = -1;
                        afterburnSource = -1;
                    }
            }
        }
       
        with(LooseSheet)
        {
            dir = point_direction(other.x, other.y, x, y);
            dist = point_distance(other.x, other.y, x, y);
            angle = abs((dir-other.owner.aimDirection)+720) mod 360;
            if collision_circle(x,y,25,other.poof,false,true)
            {
                motion_add(other.owner.aimDirection, other.blastStrength*(1-dist/other.blastDistance) );
            }
        }
       
        with(Gib)
        {
            dir = point_direction(other.x, other.y, x, y);
            dist = point_distance(other.x, other.y, x, y);
            angle = abs((dir-other.owner.aimDirection)+720) mod 360;
            if collision_circle(x,y,25,other.poof,false,true)
            {
                motion_add(other.owner.aimDirection, other.blastStrength*(1-dist/other.blastDistance) );
            }
        }
       
        //Finish
        justBlast = true;
        readyToBlast=false;
        readyToShoot=false;
        alarm[5]=blastReloadTime;
        isRefilling = false;
        alarm[1]=blastReloadTime;
        alarm[0]=blastNoFlameTime;
        ammoCount -= 40;
    }
}
')

object_event_clear(Flame,ev_create,0)
object_event_add(Flame,ev_create,0,'
hitDamage = 3.2;
flameLife = 15;
burnIncrease = 1;
durationIncrease = 30;
afterburnFalloff = true;
event_inherited();
')

object_event_clear(Flare,ev_create,0)
object_event_add(Flare,ev_create,0,'
hitDamage = 25;
flameLife = 40;
burnIncrease = 8;
durationIncrease = 50;
afterburnFalloff = false;
event_inherited();
')

object_event_clear(Flamethrower,ev_destroy,0)
object_event_add(Flamethrower,ev_destroy,0,'
loopsoundstop(FlamethrowerSnd);
')

To use this plugin add "buffpyro" to the end of "ServerPluginList". Split multiple server plugins with a comma.
http://www.ganggarrison.com/forums/index.php?action=dlattach;topic=34846.0;attach=16199
« Last Edit: February 16, 2014, 06:00:34 am by Derpduck [LORD] »
Logged

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1647
  • Personal Text
Re: [Server-sent Plugin] Buff Pyro
« Reply #1 on: November 02, 2013, 05:57:40 am »

What exactly does it do?
Logged

Derpduck

  • 2011 Haxxy Finalist
  • *
  • Karma: 42
  • Offline Offline
  • Posts: 5752
Re: [Server-sent Plugin] Buff Pyro
« Reply #2 on: November 02, 2013, 06:00:47 am »

Makes pyro somewhat weaker than he was during 2.4 but much better than he is now.

Look though the code and compare it with vanilla to see the changes.
« Last Edit: November 02, 2013, 06:01:08 am by Derpduck [LORD] »
Logged

\esc144aAroundTheWorld\esca

  • stinkier foot
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 2738
Re: [Server-sent Plugin] Buff Pyro
« Reply #3 on: November 02, 2013, 07:27:09 am »

You've been busy.
Logged

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: [Server-sent Plugin] Buff Pyro
« Reply #4 on: November 02, 2013, 07:50:56 am »

FIRE RAINING FROM THE SKIES

 :wuv: :wuv: :wuv: :wuv: :wuv: :wuv: :wuv: :wuv: :wuv:
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Derpduck

  • 2011 Haxxy Finalist
  • *
  • Karma: 42
  • Offline Offline
  • Posts: 5752
Re: [Server-sent Plugin] Buff Pyro
« Reply #5 on: November 02, 2013, 08:18:48 am »

Hmm, that was not what I intended. Give me some time to fix that.

Edit: I don't know why it does that, it shouldn't and I don't think I've changed anything that would make it do so.
« Last Edit: November 02, 2013, 08:39:17 am by Derpduck [LORD] »
Logged

Derpduck

  • 2011 Haxxy Finalist
  • *
  • Karma: 42
  • Offline Offline
  • Posts: 5752
Re: [Server-sent Plugin] Buff Pyro
« Reply #6 on: November 02, 2013, 09:11:54 am »

I've fixed it.

TheSpyroIsaSPY

  • New Account
  • Karma: 0
  • Offline Offline
  • Posts: 1
  • Mpmhhhh Mph
Re: [Server-sent Plugin] Buff Pyro
« Reply #7 on: November 04, 2013, 02:41:36 pm »

Epic for  punishing those scouts and spyes so MPHMMM  :x22: :e: :c5:   :woot:

EPIC  :IAMONFIRE:
Logged
----------------------------------------------------
THAT SPYRO IS A SPY! :)

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1647
  • Personal Text
Re: [Server-sent Plugin] Buff Pyro
« Reply #8 on: November 05, 2013, 10:26:05 am »

You might want to reduce the range a little.
Also when you go away when a pyro is flaming at that moment, as soon as he is offscreen the BRRRRRSSSSSSHH sound from the flamethrower will keep playing until:
A) He stops flaming when he is on screen again
B) You die
Logged

Derpduck

  • 2011 Haxxy Finalist
  • *
  • Karma: 42
  • Offline Offline
  • Posts: 5752
Re: [Server-sent Plugin] Buff Pyro
« Reply #9 on: November 06, 2013, 12:39:57 pm »

AJF doesn't seem to have updated the plugin to the fixed version I posted, so don't use it until then.

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: [Server-sent Plugin] Buff Pyro
« Reply #10 on: November 06, 2013, 01:16:30 pm »

AJF doesn't seem to have updated the plugin to the fixed version I posted, so don't use it until then.
You need to message me when you update a plugin, I don't watch threads :-\
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

pajama bin laden

  • Fool
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 11
  • i am sanic hegehog
Re: [Server-sent Plugin] Buff Pyro
« Reply #11 on: November 07, 2013, 04:30:53 am »

is this how pyro be when buffed in 2.7?
Logged
its'a me sanic hegehog

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: [Server-sent Plugin] Buff Pyro
« Reply #12 on: November 07, 2013, 05:09:58 am »

is this how pyro be when buffed in 2.7?
No.
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1647
  • Personal Text
Re: [Server-sent Plugin] Buff Pyro
« Reply #13 on: November 09, 2013, 02:57:48 am »

Is the version on the /plugins-page updated yet?
Logged

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: [Server-sent Plugin] Buff Pyro
« Reply #14 on: November 12, 2013, 07:24:45 am »

Is the version on the /plugins-page updated yet?
It is now after you pinged me.

But for future reference, please:
If you want me to review and upload your plugin, PM me.

If you want me to update your plugin, PM me.

I will not monitor your threads, nor new threads in this section, and it is not my job to do so. Tell me when your plugin needs updating and send me a zip file, don't expect me to just know it does somehow.

Thanks!
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.
Pages: [1] 2
 

Page created in 0.045 seconds with 30 queries.