mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-04-08 00:14:00 +02:00
Allow pipe to grab from photon map, BRAY beam takes temp from ARAY
This commit is contained in:
parent
4c2f8d56f1
commit
d17336b467
@ -618,7 +618,7 @@ static const part_type ptypes[PT_NUM] =
|
||||
{"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER2, 373.0f, 40, "Lolz", ST_GAS, TYPE_SOLID, &update_MISC, NULL},
|
||||
{"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 2, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", ST_SOLID, TYPE_SOLID, &update_WIFI, &graphics_WIFI},
|
||||
{"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", ST_SOLID, TYPE_SOLID, NULL, &graphics_FILT},
|
||||
{"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Emitter. Rays create points when they collide", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_ARAY, NULL},
|
||||
{"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Ray Emitter. Rays create points when they collide", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC, &update_ARAY, NULL},
|
||||
{"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, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", ST_SOLID, TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL, NULL, &graphics_BRAY},
|
||||
{"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, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", ST_NONE, 0, &update_STKM2, &graphics_STKM2},
|
||||
{"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, 1, 30, SC_EXPLOSIVE, R_TEMP-2.0f +273.15f, 29, "Bomb.", ST_NONE, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_BOMB, &graphics_BOMB},
|
||||
|
@ -27,6 +27,7 @@ int update_ARAY(UPDATE_FUNC_ARGS) {
|
||||
parts[nr].life = 2;
|
||||
} else
|
||||
parts[nr].ctype = colored;
|
||||
parts[nr].temp = parts[i].temp;
|
||||
}
|
||||
} else if (!destroy) {
|
||||
if ((r&0xFF)==PT_BRAY&&parts[r>>8].tmp==0) {//if it hits another BRAY that isn't red
|
||||
|
@ -130,6 +130,8 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
|
||||
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
|
||||
{
|
||||
r = pmap[y+ry][x+rx];
|
||||
if(!r)
|
||||
r = photons[y+ry][x+rx];
|
||||
if (surround_space && !r && (parts[i].tmp&0xFF)!=0) //creating at end
|
||||
{
|
||||
np = create_part(-1,x+rx,y+ry,parts[i].tmp&0xFF);
|
||||
@ -240,45 +242,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
|
||||
|
||||
int graphics_PIPE(GRAPHICS_FUNC_ARGS)
|
||||
{
|
||||
if (cpart->ctype==2)
|
||||
{
|
||||
*colr = 50;
|
||||
*colg = 1;
|
||||
*colb = 1;
|
||||
}
|
||||
else if (cpart->ctype==3)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 50;
|
||||
*colb = 1;
|
||||
}
|
||||
else if (cpart->ctype==4)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 1;
|
||||
*colb = 50;
|
||||
}
|
||||
else if (cpart->temp<272.15&&cpart->ctype!=1)
|
||||
{
|
||||
if (cpart->temp>173.25&&cpart->temp<273.15)
|
||||
{
|
||||
*colr = 50;
|
||||
*colg = 1;
|
||||
*colb = 1;
|
||||
}
|
||||
if (cpart->temp>73.25&&cpart->temp<=173.15)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 50;
|
||||
*colb = 1;
|
||||
}
|
||||
if (cpart->temp>=0&&cpart->temp<=73.15)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 1;
|
||||
*colb = 50;
|
||||
}
|
||||
}
|
||||
|
||||
if ((cpart->tmp&0xFF)>0 && (cpart->tmp&0xFF)<PT_NUM)
|
||||
{
|
||||
//Create a temp. particle and do a subcall.
|
||||
@ -317,5 +281,47 @@ int graphics_PIPE(GRAPHICS_FUNC_ARGS)
|
||||
//*colg = PIXG(ptypes[cpart->tmp&0xFF].pcolors);
|
||||
//*colb = PIXB(ptypes[cpart->tmp&0xFF].pcolors);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cpart->ctype==2)
|
||||
{
|
||||
*colr = 50;
|
||||
*colg = 1;
|
||||
*colb = 1;
|
||||
}
|
||||
else if (cpart->ctype==3)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 50;
|
||||
*colb = 1;
|
||||
}
|
||||
else if (cpart->ctype==4)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 1;
|
||||
*colb = 50;
|
||||
}
|
||||
else if (cpart->temp<272.15&&cpart->ctype!=1)
|
||||
{
|
||||
if (cpart->temp>173.25&&cpart->temp<273.15)
|
||||
{
|
||||
*colr = 50;
|
||||
*colg = 1;
|
||||
*colb = 1;
|
||||
}
|
||||
if (cpart->temp>73.25&&cpart->temp<=173.15)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 50;
|
||||
*colb = 1;
|
||||
}
|
||||
if (cpart->temp>=0&&cpart->temp<=73.15)
|
||||
{
|
||||
*colr = 1;
|
||||
*colg = 1;
|
||||
*colb = 50;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
11
src/powder.c
11
src/powder.c
@ -2250,6 +2250,17 @@ killed:
|
||||
continue;
|
||||
}
|
||||
r = pmap[fin_y][fin_x];
|
||||
|
||||
if ((r & 0xFF) == PT_PIPE && !(parts[r>>8].tmp&0xFF))
|
||||
{
|
||||
parts[r>>8].tmp = (parts[r>>8].tmp&~0xFF) | parts[i].type;
|
||||
parts[r>>8].temp = parts[i].temp;
|
||||
parts[r>>8].flags = parts[i].life;
|
||||
parts[r>>8].pavg[0] = parts[i].tmp;
|
||||
parts[r>>8].pavg[1] = parts[i].ctype;
|
||||
kill_part(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
// this should be replaced with a particle type attribute ("photwl" or something)
|
||||
if ((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user