summaryrefslogtreecommitdiff
path: root/src/elements/stkm.c
diff options
context:
space:
mode:
authorBryan Hoyle <starfoxprime@gmail.com>2011-08-24 00:29:26 (GMT)
committer Bryan Hoyle <starfoxprime@gmail.com>2011-08-24 00:29:26 (GMT)
commit578144c48a1b35ae8d0763637752d935169663ac (patch)
treead0407b144aca61502e8419c96fc385a9f5aea28 /src/elements/stkm.c
parentf577c319db982e6b3d3b3731f1980c89182da982 (diff)
parent6581c29bf7eaf07483178804199f090b1c0e43ff (diff)
downloadpowder-578144c48a1b35ae8d0763637752d935169663ac.zip
powder-578144c48a1b35ae8d0763637752d935169663ac.tar.gz
Merge remote branch 'origin/master'
Diffstat (limited to 'src/elements/stkm.c')
-rw-r--r--src/elements/stkm.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/src/elements/stkm.c b/src/elements/stkm.c
index 4b43f57..6873ef5 100644
--- a/src/elements/stkm.c
+++ b/src/elements/stkm.c
@@ -240,7 +240,7 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) {
{
int np = -1;
if (playerp[2] == SPC_AIR)
- create_parts(rx + 3*((((int)playerp[1])&0x02) == 0x02) - 3*((((int)playerp[1])&0x01) == 0x01), ry, 4, 4, SPC_AIR);
+ create_parts(rx + 3*((((int)playerp[1])&0x02) == 0x02) - 3*((((int)playerp[1])&0x01) == 0x01), ry, 4, 4, SPC_AIR, 0);
else
np = create_part(-1, rx, ry, playerp[2]);
if ( (np < NPART) && np>=0 && playerp[2] != PT_PHOT && playerp[2] != SPC_AIR)
@@ -389,21 +389,23 @@ void STKM_interact(float* playerp, int i, int x, int y)
if ((r&0xFF)==PT_PLUT) //If on plut
parts[i].life -= 1;
+
+ if (ptypes[r&0xFF].properties&PROP_DEADLY)
+ parts[i].life -= 1;
if ((r&0xFF)==PT_PRTI && parts[i].type)
{
- int nnx, count;
+ int nnx, count=1;//gives rx=0, ry=1 in update_PRTO
parts[r>>8].tmp = (int)((parts[r>>8].temp-73.15f)/100+1);
if (parts[r>>8].tmp>=CHANNELS) parts[r>>8].tmp = CHANNELS-1;
else if (parts[r>>8].tmp<0) parts[r>>8].tmp = 0;
- for (count=1; count<=8; count++)
- for (nnx=0; nnx<80; nnx++)
- if (!portalp[parts[r>>8].tmp][count-1][nnx].type)
- {
- portalp[parts[r>>8].tmp][count-1][nnx] = parts[i];
- kill_part(i);
- playerp[27] = 1;//stop SPWN creating a new STKM while he is in portal
- }
+ for (nnx=0; nnx<80; nnx++)
+ if (!portalp[parts[r>>8].tmp][count][nnx].type)
+ {
+ portalp[parts[r>>8].tmp][count][nnx] = parts[i];
+ kill_part(i);
+ playerp[27] = 1;//stop SPWN creating a new STKM while he is in portal
+ }
}
}
}
@@ -415,23 +417,23 @@ void STKM_init_legs(float* playerp, int i)
x = (int)(parts[i].x+0.5f);
y = (int)(parts[i].y+0.5f);
- player[3] = x-1;
- player[4] = y+6;
- player[5] = x-1;
- player[6] = y+6;
-
- player[7] = x-3;
- player[8] = y+12;
- player[9] = x-3;
- player[10] = y+12;
-
- player[11] = x+1;
- player[12] = y+6;
- player[13] = x+1;
- player[14] = y+6;
-
- player[15] = x+3;
- player[16] = y+12;
- player[17] = x+3;
- player[18] = y+12;
+ playerp[3] = x-1;
+ playerp[4] = y+6;
+ playerp[5] = x-1;
+ playerp[6] = y+6;
+
+ playerp[7] = x-3;
+ playerp[8] = y+12;
+ playerp[9] = x-3;
+ playerp[10] = y+12;
+
+ playerp[11] = x+1;
+ playerp[12] = y+6;
+ playerp[13] = x+1;
+ playerp[14] = y+6;
+
+ playerp[15] = x+3;
+ playerp[16] = y+12;
+ playerp[17] = x+3;
+ playerp[18] = y+12;
}