-
Notifications
You must be signed in to change notification settings - Fork 14
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
0872680
commit 791a928
Showing
14 changed files
with
239 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef GLAGGLER_H | ||
#define GLAGGLER_H | ||
|
||
#include "../element.h" | ||
|
||
class GlagglerEye: public Element { | ||
public: | ||
const double DECAY = 1.0 / 2048; | ||
|
||
void process(SandSimulation *sim, int row, int col) override { | ||
if (sim->randf() < DECAY) { | ||
sim->set_cell(row, col, 177); | ||
} | ||
} | ||
|
||
double get_density() override { | ||
return 129.0; | ||
} | ||
|
||
double get_explode_resistance() override { | ||
return 1.0; | ||
} | ||
|
||
double get_acid_resistance() override { | ||
return 1.0; | ||
} | ||
|
||
int get_state() override { | ||
return 0; | ||
} | ||
|
||
int get_temperature() override { | ||
return 1; | ||
} | ||
|
||
int get_toxicity() override { | ||
return 1; | ||
} | ||
}; | ||
|
||
#endif // GLAGGLER_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,41 @@ | ||
#ifndef GLAGGLER_FACE | ||
#define GLAGGLER_FACE | ||
|
||
#include "../element.h" | ||
|
||
class GlagglerFace: public Element { | ||
public: | ||
const double DECAY = 1.0 / 2048; | ||
|
||
void process(SandSimulation *sim, int row, int col) override { | ||
if (sim->randf() < DECAY) { | ||
sim->set_cell(row, col, 9); | ||
} | ||
} | ||
|
||
double get_density() override { | ||
return 129.0; | ||
} | ||
|
||
double get_explode_resistance() override { | ||
return 1.0; | ||
} | ||
|
||
double get_acid_resistance() override { | ||
return 1.0; | ||
} | ||
|
||
int get_state() override { | ||
return 0; | ||
} | ||
|
||
int get_temperature() override { | ||
return 1; | ||
} | ||
|
||
int get_toxicity() override { | ||
return 1; | ||
} | ||
}; | ||
|
||
#endif // GLAGGLER_FACE |
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,88 @@ | ||
#ifndef GLAGGLER_SEED_H | ||
#define GLAGGLER_SEED_H | ||
|
||
#include "../element.h" | ||
|
||
class GlagglerSeed: public Element { | ||
public: | ||
const double FLAME = 1 / 64.0; | ||
const double POWDER = 1 / 1.05; | ||
const double AWAKEN = 1 / 2048.0; | ||
|
||
void process(SandSimulation *sim, int row, int col) override { | ||
if (sim->randf() >= POWDER) | ||
return; | ||
if (sim->randf() < FLAME && sim->is_on_fire(row, col)) { | ||
sim->set_cell(row, col, 20); | ||
return; | ||
} | ||
if (sim->randf() < AWAKEN) { | ||
for (int i = -4; i <= 4; i++) { | ||
for (int j = -3; j <= 4; j++) { | ||
if (!sim->in_bounds(row + j, col + i)) { | ||
continue; | ||
} | ||
if ((j == -3 || j == 4) && (i <= -3 || i >= 3)) { | ||
continue; | ||
} | ||
if ((j == -2 || j == 3) && (i <= -4 || i >= 4)) { | ||
continue; | ||
} | ||
|
||
if (j == -1 && (i == -1 || i == 1)) { | ||
sim->set_cell(row + j, col + i, 176); | ||
continue; | ||
} | ||
if (j == 1 && (i == -3 || i == 3)) { | ||
sim->set_cell(row + j, col + i, 176); | ||
continue; | ||
} | ||
if (j == 2 && (i >= -2 && i <= 2)) { | ||
sim->set_cell(row + j, col + i, 176); | ||
continue; | ||
} | ||
sim->set_cell(row + j, col + i, 177); | ||
} | ||
} | ||
return; | ||
} | ||
bool bot_left = sim->is_swappable(row, col, row + 1, col - 1); | ||
bool bot = sim->is_swappable(row, col, row + 1, col); | ||
bool bot_right = sim->is_swappable(row, col, row + 1, col + 1); | ||
if (bot) { | ||
sim->move_and_swap(row, col, row + 1, col); | ||
} else if (bot_left && bot_right) { | ||
sim->move_and_swap(row, col, row + 1, col + (sim->randf() < 0.5 ? 1 : -1)); | ||
} else if (bot_left) { | ||
sim->move_and_swap(row, col, row + 1, col - 1); | ||
} else if (bot_right) { | ||
sim->move_and_swap(row, col, row + 1, col + 1); | ||
} | ||
} | ||
|
||
double get_density() override { | ||
return 2.0; | ||
} | ||
|
||
double get_explode_resistance() override { | ||
return 0.85; | ||
} | ||
|
||
double get_acid_resistance() override { | ||
return 0.2; | ||
} | ||
|
||
int get_state() override { | ||
return 0; | ||
} | ||
|
||
int get_temperature() override { | ||
return 0; | ||
} | ||
|
||
int get_toxicity() override { | ||
return 0; | ||
} | ||
}; | ||
|
||
#endif // GLAGGLER_SEED_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 |
---|---|---|
|
@@ -31,7 +31,6 @@ class Missile: public Element { | |
} | ||
} | ||
} | ||
return; | ||
} | ||
|
||
|
||
|
Binary file modified
BIN
+9.94 KB
(100%)
extension/sand_simulation.windows.template_debug.x86_64.obj
Binary file not shown.
Binary file modified
BIN
+2.5 KB
(100%)
game/bin/fallingsand/libgdfallingsand.windows.template_debug.x86_64.dll
Binary file not shown.
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
8 changes: 8 additions & 0 deletions
8
game/main/element_manager/element_material/glaggler_core.tres
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,8 @@ | ||
[gd_resource type="Resource" script_class="FlatColor" load_steps=2 format=3 uid="uid://ohoxfasxfhd0"] | ||
|
||
[ext_resource type="Script" path="res://main/element_manager/element_material/types/flat_color.gd" id="1_o4fod"] | ||
|
||
[resource] | ||
script = ExtResource("1_o4fod") | ||
color = Color(1, 0.180392, 0.0705882, 1) | ||
id = 175 |
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,8 @@ | ||
[gd_resource type="Resource" script_class="FlatColor" load_steps=2 format=3 uid="uid://c87kkvoi5mt46"] | ||
|
||
[ext_resource type="Script" path="res://main/element_manager/element_material/types/flat_color.gd" id="1_wir3g"] | ||
|
||
[resource] | ||
script = ExtResource("1_wir3g") | ||
color = Color(0.0196078, 0.0196078, 0.0196078, 1) | ||
id = 176 |
8 changes: 8 additions & 0 deletions
8
game/main/element_manager/element_material/glaggler_face.tres
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,8 @@ | ||
[gd_resource type="Resource" script_class="FlatColor" load_steps=2 format=3 uid="uid://cr12s2venmd83"] | ||
|
||
[ext_resource type="Script" path="res://main/element_manager/element_material/types/flat_color.gd" id="1_8b4kr"] | ||
|
||
[resource] | ||
script = ExtResource("1_8b4kr") | ||
color = Color(1, 0.94902, 0, 1) | ||
id = 177 |
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