Neutrons fixed somewhat

This commit is contained in:
Simon 2010-10-21 11:48:21 +01:00
parent 92b28b7879
commit e711060cb9
3 changed files with 99 additions and 85 deletions

View File

@ -190,9 +190,9 @@ char *download_ui(pixel *vid_buf, char *uri, int *len);
int search_ui(pixel *vid_buf); int search_ui(pixel *vid_buf);
int open_ui(pixel *vid_buf, char *save_id); int open_ui(pixel *vid_buf, char *save_id, char *save_date);
int info_parse(void *info_data, save_info *info); int info_parse(char *info_data, save_info *info);
int search_results(char *str, int votes); int search_results(char *str, int votes);

View File

@ -115,7 +115,8 @@
#define PT_PCLN 74 #define PT_PCLN 74
#define PT_HSWC 75 #define PT_HSWC 75
#define PT_IRON 76 #define PT_IRON 76
#define PT_NUM 77 #define PT_MORT 77
#define PT_NUM 78
#define R_TEMP 22 #define R_TEMP 22
#define MAX_TEMP 9999 #define MAX_TEMP 9999
@ -278,6 +279,7 @@ static const part_type ptypes[PT_NUM] =
{"PCLN", PIXPACK(0x3B3B10), 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_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches."}, {"PCLN", PIXPACK(0x3B3B10), 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_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches."},
{"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated"}, {"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated"},
{"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR"}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR"},
{"MORT", PIXPACK(0xE0E0E0), 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, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train."},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description
}; };

View File

@ -93,13 +93,18 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr)
if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==10) if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==10)
return 0; return 0;
if (r && ((r&0xFF) >= PT_NUM ||
(ptypes[pt].weight <= ptypes[(r&0xFF)].weight))
)
return 0;
if(pt == PT_PHOT) if(pt == PT_PHOT)
return 2; return 2;
if(pt == PT_NEUT)
return 1;
if((r&0xFF) == PT_NEUT)
return 0;
if (r && ((r&0xFF) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&0xFF)].weight)))
return 0;
return 1; return 1;
} }
@ -490,6 +495,10 @@ inline int create_part(int p, int x, int y, int t)
parts[i].vx = r*cosf(a); parts[i].vx = r*cosf(a);
parts[i].vy = r*sinf(a); parts[i].vy = r*sinf(a);
} }
if(t==PT_MORT)
{
parts[i].vx = 2;
}
if(t==PT_PHOT) if(t==PT_PHOT)
{ {
float a = (rand()%8) * 0.78540f; float a = (rand()%8) * 0.78540f;
@ -1763,6 +1772,9 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
} }
} }
else if(t==PT_MORT){
create_part(-1, x, y-1, PT_SMKE);
}
else if(t==PT_LCRY) else if(t==PT_LCRY)
{ {
for(nx=-1; nx<2; nx++) for(nx=-1; nx<2; nx++)