summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2010-12-27 22:29:05 (GMT)
committer Cracker64 <cracker642@gmail.com>2010-12-27 22:29:05 (GMT)
commit761ea03882fd779cc77ac7cb49ff59bbfe94b51e (patch)
tree65ef4ddfb0ac6d21871507050db072022055839a
parentc5c88529c228987897b722cffafad4e888604132 (diff)
downloadpowder-761ea03882fd779cc77ac7cb49ff59bbfe94b51e.zip
powder-761ea03882fd779cc77ac7cb49ff59bbfe94b51e.tar.gz
added a basic coldflame explosive, ignites from CFLM or something cold.
-rw-r--r--includes/powder.h7
-rw-r--r--src/powder.c23
2 files changed, 27 insertions, 3 deletions
diff --git a/includes/powder.h b/includes/powder.h
index 71bfe01..45e8181 100644
--- a/includes/powder.h
+++ b/includes/powder.h
@@ -177,7 +177,8 @@
#define PT_BRAY 127
#define PT_STKM2 128
#define PT_BOMB 129
-#define PT_NUM 130
+#define PT_C5 130
+#define PT_NUM 131
#define R_TEMP 22
#define MAX_TEMP 9999
@@ -400,7 +401,8 @@ static const part_type ptypes[PT_NUM] =
{"BRAY", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", TYPE_SOLID, NULL},
{"STK2", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", 0, NULL},
{"BOMB", PIXPACK(0xFFF288), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 1, 30, SC_EXPLOSIVE, R_TEMP-2.0f +273.15f, 29, "Bomb.", TYPE_PART, NULL},
- //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description
+ {"C-5", PIXPACK(0x2050E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Cold explosive", TYPE_SOLID | PROP_NEUTPENETRATE, NULL},
+ //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description
};
static part_state pstates[PT_NUM] =
@@ -536,6 +538,7 @@ static part_state pstates[PT_NUM] =
/* BRAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* STKM2*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 620.0f},
/* BOMB */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
+ /* C-5 */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
};
static int grule[NGOL][9] =
diff --git a/src/powder.c b/src/powder.c
index ce3c4fa..2c7944e 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -2792,7 +2792,28 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
- else if(t==PT_BOMB)
+ else if(t==PT_C5)
+ {
+ for(nx=-2; nx<3; nx++)
+ for(ny=-2; ny<3; ny++)
+ if(x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
+ {
+ r = pmap[y+ny][x+nx];
+ if((r>>8)>=NPART || !r)
+ continue;
+ if((parts[r>>8].temp<100 && parts[r>>8].type!=PT_C5)||parts[r>>8].type==PT_HFLM)
+ {
+ if(1>rand()%6)
+ {
+ t = parts[i].type = PT_HFLM;
+ parts[r>>8].temp = parts[i].temp = 0;
+ parts[i].life = rand()%150+50;
+ pv[y/CELL][x/CELL] += 1.5;
+ }
+ }
+ }
+ }
+ else if(t==PT_BOMB)
{
int nb;
if(parts[i].tmp==1){