-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acc3465
commit a5b841f
Showing
6 changed files
with
161 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#ifndef GOLD_H | ||
#define GOLD_H | ||
|
||
|
||
|
||
#include "../element.h" | ||
|
||
class Gold: public Element { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef LEAD_H | ||
#define LEAD_H | ||
|
||
#include "../element.h" | ||
|
||
class Lead: public Element { | ||
public: | ||
const double PLASMA = 1.0 / 16; | ||
const double MELT = 1.0 / 32; | ||
const double TRANSMUTE = 1.0 / 2; | ||
|
||
void process(SandSimulation *sim, int row, int col) override { | ||
if (sim->randf() < PLASMA && (sim->touch_count(row, col, 38) > 0 || sim->touch_count(row, col, 40) > 0 || sim->touch_count(row, col, 115) > 0)) { | ||
sim->grow(row + 1, col, 135, 38); | ||
sim->grow(row - 1, col, 135, 38); | ||
sim->grow(row, col - 1, 135, 38); | ||
sim->grow(row, col + 1, 135, 38); | ||
return; | ||
} else if (sim -> randf() < MELT && (sim->touch_count(row, col, 20) + sim->touch_count(row, col, 24) > 0)) { | ||
sim->set_cell(row, col, 20); | ||
} else if (sim->randf() < TRANSMUTE && sim->touch_count(row, col, 23) > 0) { | ||
sim->set_cell(row, col, 51); | ||
} | ||
} | ||
|
||
double get_density() override { | ||
return 90.0; | ||
} | ||
|
||
double get_explode_resistance() override { | ||
return 0.64; | ||
} | ||
|
||
double get_acid_resistance() override { | ||
return 0.92; | ||
} | ||
|
||
int get_state() override { | ||
return 0; | ||
} | ||
|
||
int get_temperature() override { | ||
return 0; | ||
} | ||
|
||
int get_toxicity() override { | ||
return 1; | ||
} | ||
}; | ||
|
||
#endif // LEAD_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef MOLTEN_SILVER_H | ||
#define MOLTEN_SILVER_H | ||
|
||
#include "../element.h" | ||
#include <stdlib.h> | ||
|
||
class MoltenSilver: public Element { | ||
public: | ||
const double MELT = 1.0 / 80; | ||
const double DOWN_BLOCK = 1.0 / 16; | ||
const double DOWN = 1.0 / 1.5; | ||
const double COOL = 1.0 / 128; | ||
const double REG_COOL = 1.0 / 1900; | ||
|
||
void process(SandSimulation *sim, int row, int col) override { | ||
// Conductivity | ||
if (sim->randf() < MELT && (sim->touch_count(row, col, 38) > 0 || sim->touch_count(row, col, 40) > 0 || sim->touch_count(row, col, 115) > 0)) { | ||
sim->set_cell(row, col, 38); | ||
return; | ||
} | ||
|
||
if (sim->randf() < COOL && (sim->is_cold(row, col) || sim->touch_count(row, col, 0) > 0) || sim->randf() < REG_COOL) { | ||
sim->set_cell(row, col, 133); | ||
return; | ||
} | ||
|
||
sim->liquid_process(row, col, 3); | ||
} | ||
|
||
double get_density() override { | ||
return 64.0; | ||
} | ||
|
||
double get_explode_resistance() override { | ||
return 0.90; | ||
} | ||
|
||
double get_acid_resistance() override { | ||
return 0.999; | ||
} | ||
|
||
int get_state() override { | ||
return 1; | ||
} | ||
|
||
int get_temperature() override { | ||
return 1; | ||
} | ||
|
||
int get_toxicity() override { | ||
return 0; | ||
} | ||
}; | ||
|
||
#endif // MOLTEN_SILVER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef SILVER_H | ||
#define SILVER_H | ||
|
||
#include "../element.h" | ||
|
||
class GoSilverld: public Element { | ||
public: | ||
const double PLASMA = 1.0 / 8; | ||
const double MELT = 1.0 / 32; | ||
const double EXPLODE = 1.0 / 90; | ||
void process(SandSimulation *sim, int row, int col) override { | ||
if (sim->randf() < PLASMA && (sim->touch_count(row, col, 38) > 0 || sim->touch_count(row, col, 40) > 0 || sim->touch_count(row, col, 115) > 0)) { | ||
sim->grow(row + 1, col, 133, 38); | ||
sim->grow(row - 1, col, 133, 38); | ||
sim->grow(row, col - 1, 133, 38); | ||
sim->grow(row, col + 1, 133, 38); | ||
return; | ||
} else if (sim -> randf() < MELT && (sim->touch_count(row, col, 20) + sim->touch_count(row, col, 24) > 0)) { | ||
sim->set_cell(row, col, 134); | ||
} | ||
} | ||
|
||
double get_density() override { | ||
return 64.0; | ||
} | ||
|
||
double get_explode_resistance() override { | ||
return 0.48; | ||
} | ||
|
||
double get_acid_resistance() override { | ||
return 0.98; | ||
} | ||
|
||
int get_state() override { | ||
return 0; | ||
} | ||
|
||
int get_temperature() override { | ||
return 0; | ||
} | ||
|
||
int get_toxicity() override { | ||
return 0; | ||
} | ||
}; | ||
|
||
#endif // SILVER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters