summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-11-01 19:17:04 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-11-01 19:17:04 (GMT)
commit4f74cfa35dbc40be0cb6426a06d2eeb13b0df6c7 (patch)
treef1317cb1a771a558c065ede4af2048fcacd96583 /src/elements
parent91f4a156dfabec29ae0dbcf445462259a266ab62 (diff)
parent98e23875c83959957556a0859684b6770f76c996 (diff)
downloadpowder-4f74cfa35dbc40be0cb6426a06d2eeb13b0df6c7.zip
powder-4f74cfa35dbc40be0cb6426a06d2eeb13b0df6c7.tar.gz
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/figh.c28
-rw-r--r--src/elements/plsm.c2
-rw-r--r--src/elements/stkm.c16
-rw-r--r--src/elements/wire.c27
4 files changed, 59 insertions, 14 deletions
diff --git a/src/elements/figh.c b/src/elements/figh.c
index 99f39b1..284a56c 100644
--- a/src/elements/figh.c
+++ b/src/elements/figh.c
@@ -45,20 +45,34 @@ int update_FIGH(UPDATE_FUNC_ARGS)
case 1:
if ((pow(tarx-x, 2) + pow(tary-y, 2))<600)
{
- if (figh->elem == PT_FIRE || figh->elem == PT_LIGH)
+ if (figh->elem == PT_LIGH || figh->elem == PT_NEUT
+ || ptypes[figh->elem].properties&(PROP_DEADLY|PROP_RADIOACTIVE)
+ || ptypes[figh->elem].heat>=323 || ptypes[figh->elem].heat<=243)
figh->comm = (int)figh->comm | 0x08;
}
else
- if (tarx<x)
+ if (tarx<x )
{
- figh->comm = 0x01;
- if (!eval_move(PT_DUST, figh->legs[4]-4, figh->legs[5]-1, NULL) || !eval_move(PT_DUST, figh->legs[12]-4, figh->legs[13]-1, NULL))
+ if(!eval_move(PT_DUST, figh->legs[4]-10, figh->legs[5]+6, NULL))
+ figh->comm = 0x01;
+ else
+ figh->comm = 0x02;
+
+ if (!eval_move(PT_DUST, figh->legs[4]-4, figh->legs[5]-1, NULL)
+ || !eval_move(PT_DUST, figh->legs[12]-4, figh->legs[13]-1, NULL)
+ || eval_move(PT_DUST, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL))
figh->comm = (int)figh->comm | 0x04;
}
else
- {
- figh->comm = 0x02;
- if (!eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL) || !eval_move(PT_DUST, figh->legs[12]+4, figh->legs[13]-1, NULL))
+ {
+ if (!eval_move(PT_DUST, figh->legs[12]+10, figh->legs[13]+6, NULL))
+ figh->comm = 0x02;
+ else
+ figh->comm = 0x01;
+
+ if (!eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL)
+ || !eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL)
+ || eval_move(PT_DUST, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL))
figh->comm = (int)figh->comm | 0x04;
}
break;
diff --git a/src/elements/plsm.c b/src/elements/plsm.c
index 7fa99bb..aeb1611 100644
--- a/src/elements/plsm.c
+++ b/src/elements/plsm.c
@@ -13,7 +13,7 @@ int graphics_PLSM(GRAPHICS_FUNC_ARGS)
*fireg = *colg;
*fireb = *colb;
- *pixel_mode = PMODE_GLOW; //Clear default, don't draw pixel
+ *pixel_mode = PMODE_GLOW | PMODE_ADD; //Clear default, don't draw pixel
*pixel_mode |= FIRE_ADD;
//Returning 0 means dynamic, do not cache
return 0;
diff --git a/src/elements/stkm.c b/src/elements/stkm.c
index e8a1241..be3506d 100644
--- a/src/elements/stkm.c
+++ b/src/elements/stkm.c
@@ -426,14 +426,18 @@ void STKM_interact(playerst* playerp, int i, int x, int y)
parts[i].life -= 2;
playerp->accs[3] -= 1;
}
-
- if ((r&0xFF)==PT_ACID) //If on acid
- parts[i].life -= 5;
-
- if ((r&0xFF)==PT_PLUT) //If on plut
- parts[i].life -= 1;
if (ptypes[r&0xFF].properties&PROP_DEADLY)
+ switch (r&0xFF)
+ {
+ case PT_ACID:
+ parts[i].life -= 5;
+ break;
+ default:
+ parts[i].life -= 1;
+ }
+
+ if (ptypes[r&0xFF].properties&PROP_RADIOACTIVE)
parts[i].life -= 1;
if ((r&0xFF)==PT_PRTI && parts[i].type)
diff --git a/src/elements/wire.c b/src/elements/wire.c
index d4225a5..e48e131 100644
--- a/src/elements/wire.c
+++ b/src/elements/wire.c
@@ -38,3 +38,30 @@ int update_WIRE(UPDATE_FUNC_ARGS) {
parts[i].ctype=1;
return 0;
}
+
+int graphics_WIRE(GRAPHICS_FUNC_ARGS)
+{
+ if (cpart->ctype==0)
+ {
+ *colr = 255;
+ *colg = 204;
+ *colb = 0;
+ return 0;
+ }
+ if (cpart->ctype==1)
+ {
+ *colr = 50;
+ *colg = 100;
+ *colb = 255;
+ //*pixel_mode |= PMODE_GLOW;
+ return 0;
+ }
+ if (cpart->ctype==2)
+ {
+ *colr = 255;
+ *colg = 100;
+ *colb = 50;
+ //*pixel_mode |= PMODE_GLOW;
+ return 0;
+ }
+}