summaryrefslogtreecommitdiff
path: root/src/elements/stkm2.c
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-13 21:24:19 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-13 21:31:24 (GMT)
commit9707443b243bafd4c65fd8c92fa97d99260a2e3c (patch)
tree12b41b708a1315d09cda03873e2c7d5cb32862a3 /src/elements/stkm2.c
parenta23138fbbec43f31e265a908c935b700558e1467 (diff)
downloadpowder-9707443b243bafd4c65fd8c92fa97d99260a2e3c.zip
powder-9707443b243bafd4c65fd8c92fa97d99260a2e3c.tar.gz
Merge element state into ptypes.
All of the pstates array except .state was replaced by ptransitions.
Diffstat (limited to 'src/elements/stkm2.c')
-rw-r--r--src/elements/stkm2.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/elements/stkm2.c b/src/elements/stkm2.c
index 5d5da8a..805cb73 100644
--- a/src/elements/stkm2.c
+++ b/src/elements/stkm2.c
@@ -85,9 +85,9 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
player2[26] = 0;
//Go left
- if (((int)(player2[0])&0x01) == 0x01 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS)
+ if (((int)(player2[0])&0x01) == 0x01 && ptypes[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS)
{
- if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID
+ if (ptypes[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID
&& (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG)
{
if (pmap[(int)(player2[8]-1)][(int)(player2[7])])
@@ -123,9 +123,9 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
}
//Go right
- if (((int)(player2[0])&0x02) == 0x02 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS)
+ if (((int)(player2[0])&0x02) == 0x02 && ptypes[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS)
{
- if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID
+ if (ptypes[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID
&& (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG)
{
if (pmap[(int)(player2[8]-1)][(int)(player2[7])])
@@ -162,7 +162,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
}
//Jump
- if (((int)(player2[0])&0x04) == 0x04 && (pstates[pmap[(int)(player2[8]-0.5)][(int)(player2[7])]&0xFF].state != ST_GAS || pstates[pmap[(int)(player2[16]-0.5)][(int)(player2[15])]&0xFF].state != ST_GAS))
+ if (((int)(player2[0])&0x04) == 0x04 && (ptypes[pmap[(int)(player2[8]-0.5)][(int)(player2[7])]&0xFF].state != ST_GAS || ptypes[pmap[(int)(player2[16]-0.5)][(int)(player2[15])]&0xFF].state != ST_GAS))
{
if (pmap[(int)(player2[8]-0.5)][(int)(player2[7])] || pmap[(int)(player2[16]-0.5)][(int)(player2[15])])
{
@@ -219,7 +219,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
r = pmap[ry][rx];
if (!((r>>8)>=NPART))
{
- if (pstates[r&0xFF].state == ST_SOLID)
+ if (ptypes[r&0xFF].state == ST_SOLID)
{
create_part(-1, rx, ry, PT_SPRK);
}
@@ -281,11 +281,11 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
for (rx = -3; rx <= 3; rx++)
{
r = pmap[(int)(player2[16]-2)][(int)(player2[15]+rx)];
- if (r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID)
+ if (r && ptypes[r&0xFF].state != ST_GAS && ptypes[r&0xFF].state != ST_LIQUID)
player2[15] -= rx;
r = pmap[(int)(player2[8]-2)][(int)(player2[7]+rx)];
- if (r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID)
+ if (r && ptypes[r&0xFF].state != ST_GAS && ptypes[r&0xFF].state != ST_LIQUID)
player2[7] -= rx;
}
@@ -297,7 +297,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
//For left leg
if (r && (r&0xFF)!=PT_STKM)
{
- if (pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) //Liquid checks
+ if (ptypes[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) //Liquid checks
{
if (parts[i].y<(player2[8]-10))
parts[i].vy = 1*dt;
@@ -308,7 +308,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
}
else
{
- if (pstates[r&0xFF].state != ST_GAS)
+ if (ptypes[r&0xFF].state != ST_GAS)
{
player2[8] += ry-1;
parts[i].vy -= 0.5*parts[i].vy*dt;
@@ -322,7 +322,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
//For right leg
if (r && (r&0xFF)!=PT_STKM)
{
- if (pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG)
+ if (ptypes[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG)
{
if (parts[i].y<(player2[16]-10))
parts[i].vy = 1*dt;
@@ -333,7 +333,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
}
else
{
- if (pstates[r&0xFF].state != ST_GAS)
+ if (ptypes[r&0xFF].state != ST_GAS)
{
player2[16] += ry-1;
parts[i].vy -= 0.5*parts[i].vy*dt;