Permalink
Browse files

Heavy tweaks (sandvich/ammo)

Sandwich now heals full health and has a 15 second cooldown.
Ammo has no annoying "event horizon" and a lower reload buffer.
  • Loading branch information...
1 parent a1bd74f commit 40504dd3e5363b0a8de5a68989dcf9d32415f1be @wareya committed Jan 11, 2012
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<event category="ALARM" id="6">
+ <actions>
+ <action id="605" library="1">
+ <!--action name: Comment-->
+ <kind>NORMAL</kind>
+ <allowRelative>false</allowRelative>
+ <question>false</question>
+ <canApplyTo>false</canApplyTo>
+ <actionType>NONE</actionType>
+ <functionName/>
+ <relative>false</relative>
+ <not>false</not>
+ <appliesTo>.self</appliesTo>
+ <arguments>
+ <argument kind="STRING">sandvich cooldown</argument>
+ </arguments>
+ </action>
+ <action id="603" library="1">
+ <!--action name: Code-->
+ <kind>CODE</kind>
+ <allowRelative>false</allowRelative>
+ <question>false</question>
+ <canApplyTo>true</canApplyTo>
+ <actionType>CODE</actionType>
+ <functionName/>
+ <relative>false</relative>
+ <not>false</not>
+ <appliesTo>.self</appliesTo>
+ <arguments>
+ <argument kind="STRING">canEat = true;
+</argument>
+ </arguments>
+ </action>
+ </actions>
+</event>
@@ -92,6 +92,8 @@
//sandvich
omnomnomnom = false;
+ canEat = true;
+ eatCooldown = 450;//15 sec cooldown
//sniper zoom
zoomed = 0;
@@ -83,7 +83,7 @@ if (omnomnomnom)
{
omnomnomnomindex += 0.25;
image_xscale=xscale;
- if hp &lt;= maxHp hp += 0.4;
+ if hp &lt;= maxHp hp += 1.6;
if omnomnomnomindex &gt;= omnomnomnomend omnomnomnom=false;
}
@@ -20,7 +20,7 @@
sndlooping = false;
maxAmmo = 200;
ammoCount = maxAmmo;
- reloadBuffer = 15;
+ reloadBuffer = 7;
isRefilling = false;
}
@@ -14,29 +14,28 @@
<appliesTo>.self</appliesTo>
<arguments>
<argument kind="STRING">{
- isRefilling = false;
- alarm[5] = reloadBuffer;
- if(readyToShoot &amp;&amp; ammoCount &gt;= 4) {
+ if(readyToShoot and ammoCount &gt;= 4)
+ {
playsound(x,y,ChaingunSnd);
var shot;
randomize();
- shot = instance_create(x+lengthdir_x(20,owner.aimDirection),y+12+lengthdir_y(20,owner.aimDirection),Shot);
- shot.direction=owner.aimDirection+(random(14)-7);
- shot.speed=12+random(1);
- shot.owner=owner;
- shot.ownerPlayer=ownerPlayer;
- shot.team=owner.team;
- shot.weapon=WEAPON_MINIGUN;
- with(shot) {
- hspeed+=owner.hspeed;
- alarm[0]=30;
- //motion_add(owner.direction, owner.speed);
- }
+
+ shot = instance_create(x+lengthdir_x(20,owner.aimDirection),y+12+lengthdir_y(20,owner.aimDirection),Shot);
+ shot.direction=owner.aimDirection+(random(14)-7);
+ shot.speed=12+random(1);
+ shot.owner=owner;
+ shot.ownerPlayer=ownerPlayer;
+ shot.team=owner.team;
+ shot.weapon=WEAPON_MINIGUN;
+ shot.hspeed += owner.hspeed;
+ shot.alarm[0] = 30;
+
justShot=true;
readyToShoot=false;
- ammoCount-=3;
- if ammoCount &gt; 0 alarm[0]=refireTime;
- else alarm[0]=50;
+ isRefilling = false;
+ ammoCount -= 3;
+ alarm[0] = refireTime;
+ alarm[5] = reloadBuffer;
}
}
</argument>
@@ -293,6 +293,11 @@ do {
if(player.object != -1) {
with(player.object) {
omnomnomnom=true;
+ if(hp < 200)
+ {
+ canEat = false;
+ alarm[6] = eatCooldown; //10 second cooldown
+ }
if(player.team == TEAM_RED) {
omnomnomnomindex=0;
omnomnomnomend=31;
@@ -202,14 +202,22 @@ while(commandLimitRemaining > 0) {
case OMNOMNOMNOM:
if(player.object != -1) {
- if(player.humiliated == 0
- && player.object.taunting==false
- && player.object.omnomnomnom==false
- && player.class==CLASS_HEAVY) {
+ if(!player.humiliated
+ and !player.object.taunting
+ and !player.object.omnomnomnom
+ and player.object.canEat
+ and player.class==CLASS_HEAVY)
+ {
write_ubyte(global.sendBuffer, OMNOMNOMNOM);
write_ubyte(global.sendBuffer, playerId);
- with(player.object) {
- omnomnomnom=true;
+ with(player.object)
+ {
+ omnomnomnom = true;
+ if(hp < 200)
+ {
+ canEat = false;
+ alarm[6] = eatCooldown; //10 second cooldown
+ }
if player.team == TEAM_RED {
omnomnomnomindex=0;
omnomnomnomend=31;

0 comments on commit 40504dd

Please sign in to comment.