summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsavask <savask@yandex.ru>2011-10-31 04:36:30 (GMT)
committer savask <savask@yandex.ru>2011-11-01 16:44:17 (GMT)
commit3e5fb5942d3a4e100bbdba05a2099e82861f8996 (patch)
treeea83837814c1a0468396d19ab72043682f28671f
parent8e00d07f35394c098da073a86e1f986a1d800705 (diff)
downloadpowder-3e5fb5942d3a4e100bbdba05a2099e82861f8996.zip
powder-3e5fb5942d3a4e100bbdba05a2099e82861f8996.tar.gz
Made fighters shoot anything deadly.
-rw-r--r--includes/powder.h2
-rw-r--r--src/elements/figh.c4
-rw-r--r--src/elements/stkm.c16
3 files changed, 14 insertions, 8 deletions
diff --git a/includes/powder.h b/includes/powder.h
index 8f1cd56..006017e 100644
--- a/includes/powder.h
+++ b/includes/powder.h
@@ -507,7 +507,7 @@ static const part_type ptypes[PT_NUM] =
{"NEUT", PIXPACK(0x20E0FF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, 1, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Neutrons. Interact with matter in odd ways.", ST_GAS, TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_NEUT, &graphics_NEUT},
{"PLUT", PIXPACK(0x407020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 90, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 251, "Heavy particles. Fissile. Generates neutrons under pressure.", ST_SOLID, TYPE_PART|PROP_NEUTPENETRATE|PROP_RADIOACTIVE, &update_PLUT, NULL},
{"PLNT", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Plant, drinks water and grows.", ST_SOLID, TYPE_SOLID|PROP_NEUTPENETRATE|PROP_LIFE_DEC, &update_PLNT, NULL},
- {"ACID", PIXPACK(0xED55FF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 40, 0, 0, 1, 1, 1, 10, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything.", ST_LIQUID, TYPE_LIQUID, &update_ACID, &graphics_ACID},
+ {"ACID", PIXPACK(0xED55FF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 40, 0, 0, 1, 1, 1, 10, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything.", ST_LIQUID, TYPE_LIQUID|PROP_DEADLY, &update_ACID, &graphics_ACID},
{"VOID", PIXPACK(0x790B0B), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Hole, will drain away any particles.", ST_SOLID, TYPE_SOLID, NULL, NULL},
{"WTRV", PIXPACK(0xA0A0FF), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, -0.1f, 0.75f, 0.0003f * CFDS, 0, 0, 0, 0, 4, 1, 1, 1, SC_GAS, R_TEMP+100.0f+273.15f, 48, "Steam, heats up air, produced from hot water.", ST_GAS, TYPE_GAS, &update_WTRV, NULL},
{"CNCT", PIXPACK(0xC0C0C0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 55, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone.", ST_SOLID, TYPE_PART|PROP_HOT_GLOW, NULL, NULL},
diff --git a/src/elements/figh.c b/src/elements/figh.c
index 36cc392..284a56c 100644
--- a/src/elements/figh.c
+++ b/src/elements/figh.c
@@ -45,7 +45,9 @@ 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
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)