Skip to content

Commit

Permalink
file renaming / deletion, code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jun 4, 2017
1 parent 649133f commit 53bb1f4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 127 deletions.
111 changes: 0 additions & 111 deletions src/simulation/elements/182.cpp

This file was deleted.

Expand Up @@ -51,14 +51,14 @@ int Element_POLO::update(UPDATE_FUNC_ARGS)
const int cooldown = 15;
const int limit = 5;

int r, s;
r = sim->photons[y][x];
if(parts[i].tmp < limit && !parts[i].life)
int r = sim->photons[y][x];
if (parts[i].tmp < limit && !parts[i].life)
{
if (!(rand()%1000) &&!parts[i].tmp)
{
s = sim->create_part(-3, x, y, PT_NEUT);
if(s >= 0) {
int s = sim->create_part(-3, x, y, PT_NEUT);
if (s >= 0)
{
parts[i].life = cooldown;
parts[i].tmp ++;

Expand All @@ -68,9 +68,11 @@ int Element_POLO::update(UPDATE_FUNC_ARGS)
}


if (!(rand()%10000)) {
s = sim->create_part(-3, x, y, PT_NEUT);
if(s >= 0) {
if (!(rand()%10000))
{
int s = sim->create_part(-3, x, y, PT_NEUT);
if (s >= 0)
{
parts[i].temp = ((parts[i].temp + parts[r>>8].temp + parts[r>>8].temp) + 600.0f) / 3.0f;
parts[i].life = cooldown;
parts[i].tmp ++;
Expand All @@ -83,30 +85,37 @@ int Element_POLO::update(UPDATE_FUNC_ARGS)
}
}
}
if (parts[i].tmp2 >= 20) {
if (parts[i].tmp2 >= 20)
{
sim->part_change_type(i,x,y,PT_PLUT);
parts[i].temp = (parts[i].temp+600.0f)/2.0f;
return 1;
}
if (parts[r>>8].type == PT_PROT) {
if (parts[r>>8].type == PT_PROT)
{
parts[i].tmp2 ++;
sim->kill_part(r>>8);
}
if (parts[i].temp <388.15f) {
if (388.15f-parts[i].temp >= 0.2f) {
if (parts[i].temp < 388.15f)
{
if (parts[i].temp >= 388.15f-0.2f)
{
parts[i].temp += 0.2f;
} else {
parts[i].temp += 388.15f-parts[i].temp; //no overheating!
}
else
{
//no overheating!
parts[i].temp += 388.15f-parts[i].temp;
}
}
return 0;
}


//#TPT-Directive ElementHeader Element_POLO static int graphics(GRAPHICS_FUNC_ARGS)
int Element_POLO::graphics(GRAPHICS_FUNC_ARGS)
{
if(cpart->tmp >= 5) {
if (cpart->tmp >= 5)
{
*colr = 0x70;
*colg = 0x70;
*colb = 0x70;
Expand Down

0 comments on commit 53bb1f4

Please sign in to comment.