Skip to content

Commit

Permalink
feat: Add remaining statue spells
Browse files Browse the repository at this point in the history
  • Loading branch information
PraxTube committed Dec 13, 2023
1 parent cc7a050 commit fd4e551
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 12 deletions.
89 changes: 80 additions & 9 deletions assets/map/level.ldtk
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,10 @@
{ "id": "IgnisPila", "tileRect": null, "color": 14984818 },
{ "id": "InfernoPila", "tileRect": null, "color": 7552569 },
{ "id": "Fulgur", "tileRect": null, "color": 14120515 },
{ "id": "ScutumGlaciei", "tileRect": null, "color": 4073265 }
{ "id": "ScutumGlaciei", "tileRect": null, "color": 4073265 },
{ "id": "AerTracto", "tileRect": null, "color": 16690740 },
{ "id": "AerPello", "tileRect": null, "color": 16705377 },
{ "id": "FulgurAvis", "tileRect": null, "color": 6539085 }
], "iconTilesetUid": null, "externalRelPath": null, "externalFileChecksum": null, "tags": [] }], "externalEnums": [], "levelFields": [] },
"levels": [
{
Expand Down Expand Up @@ -9645,7 +9648,27 @@
"seed": 4912828,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
"entityInstances": [
{
"__identifier": "Item",
"__grid": [6,5],
"__pivot": [0,0],
"__tags": ["ItemSocket"],
"__tile": null,
"__smartColor": "#BE4A2F",
"__worldX": 1216,
"__worldY": -1888,
"iid": "91fc8690-8990-11ee-a9a0-218eadf69719",
"width": 32,
"height": 32,
"defUid": 42,
"px": [192,160],
"fieldInstances": [{ "__identifier": "item", "__type": "LocalEnum.Item", "__value": "AerTracto", "__tile": null, "defUid": 44, "realEditorValues": [{
"id": "V_String",
"params": ["AerTracto"]
}] }]
}
]
},
{
"__identifier": "PropsTileset",
Expand Down Expand Up @@ -9721,11 +9744,11 @@
"intGridCsv": [
0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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": 1 },
{ "px": [192,64], "src": [0,128], "f": 0, "t": 32, "d": [75,70], "a": 1 },
{ "px": [192,96], "src": [32,128], "f": 0, "t": 33, "d": [75,102], "a": 1 },
{ "px": [160,128], "src": [32,128], "f": 0, "t": 33, "d": [75,133], "a": 1 },
{ "px": [160,160], "src": [0,160], "f": 0, "t": 40, "d": [75,165], "a": 1 },
{ "px": [288,320], "src": [0,192], "f": 0, "t": 48, "d": [75,329], "a": 1 },
{ "px": [320,320], "src": [32,192], "f": 0, "t": 49, "d": [75,330], "a": 1 },
{ "px": [320,352], "src": [32,128], "f": 0, "t": 33, "d": [75,362], "a": 1 },
Expand All @@ -9773,9 +9798,12 @@
{ "px": [768,768], "src": [0,192], "f": 0, "t": 48, "d": [75,792], "a": 1 },
{ "px": [864,768], "src": [32,192], "f": 0, "t": 49, "d": [75,795], "a": 1 },
{ "px": [896,768], "src": [0,128], "f": 0, "t": 32, "d": [75,796], "a": 1 },
{ "px": [224,96], "src": [0,224], "f": 0, "t": 56, "d": [78,103], "a": 1 },
{ "px": [192,128], "src": [160,224], "f": 0, "t": 61, "d": [78,134], "a": 1 },
{ "px": [192,160], "src": [160,224], "f": 0, "t": 61, "d": [78,166], "a": 1 },
{ "px": [224,160], "src": [32,224], "f": 0, "t": 57, "d": [78,167], "a": 1 },
{ "px": [192,192], "src": [128,224], "f": 0, "t": 60, "d": [78,198], "a": 1 },
{ "px": [192,224], "src": [160,224], "f": 0, "t": 61, "d": [78,230], "a": 1 },
{ "px": [256,256], "src": [128,224], "f": 0, "t": 60, "d": [78,264], "a": 1 },
{ "px": [256,288], "src": [128,224], "f": 0, "t": 60, "d": [78,296], "a": 1 },
{ "px": [352,352], "src": [160,224], "f": 0, "t": 61, "d": [78,363], "a": 1 },
Expand All @@ -9786,6 +9814,9 @@
{ "px": [800,768], "src": [32,224], "f": 0, "t": 57, "d": [78,793], "a": 1 },
{ "px": [832,768], "src": [32,224], "f": 0, "t": 57, "d": [78,794], "a": 1 },
{ "px": [928,768], "src": [32,224], "f": 0, "t": 57, "d": [78,797], "a": 1 },
{ "px": [224,128], "src": [224,128], "f": 0, "t": 39, "d": [79,135], "a": 1 },
{ "px": [160,192], "src": [224,128], "f": 0, "t": 39, "d": [79,197], "a": 1 },
{ "px": [224,192], "src": [64,224], "f": 0, "t": 58, "d": [79,199], "a": 1 },
{ "px": [224,224], "src": [160,128], "f": 0, "t": 37, "d": [79,231], "a": 1 },
{ "px": [288,288], "src": [64,192], "f": 0, "t": 50, "d": [79,297], "a": 1 },
{ "px": [448,416], "src": [160,128], "f": 0, "t": 37, "d": [79,430], "a": 1 },
Expand Down Expand Up @@ -10929,7 +10960,27 @@
"seed": 4912828,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
"entityInstances": [
{
"__identifier": "Item",
"__grid": [17,14],
"__pivot": [0,0],
"__tags": ["ItemSocket"],
"__tile": null,
"__smartColor": "#BE4A2F",
"__worldX": 2592,
"__worldY": -1600,
"iid": "84000d00-8990-11ee-a9a0-27500624d432",
"width": 32,
"height": 32,
"defUid": 42,
"px": [544,448],
"fieldInstances": [{ "__identifier": "item", "__type": "LocalEnum.Item", "__value": "AerPello", "__tile": null, "defUid": 44, "realEditorValues": [{
"id": "V_String",
"params": ["AerPello"]
}] }]
}
]
},
{
"__identifier": "PropsTileset",
Expand Down Expand Up @@ -14862,7 +14913,27 @@
"seed": 3696000,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
"entityInstances": [
{
"__identifier": "Item",
"__grid": [21,13],
"__pivot": [0,0],
"__tags": ["ItemSocket"],
"__tile": null,
"__smartColor": "#BE4A2F",
"__worldX": 672,
"__worldY": -2656,
"iid": "fc06b730-8990-11ee-81cd-398229232ac1",
"width": 32,
"height": 32,
"defUid": 42,
"px": [672,416],
"fieldInstances": [{ "__identifier": "item", "__type": "LocalEnum.Item", "__value": "FulgurAvis", "__tile": null, "defUid": 44, "realEditorValues": [{
"id": "V_String",
"params": ["FulgurAvis"]
}] }]
}
]
},
{
"__identifier": "PropsTileset",
Expand Down
50 changes: 47 additions & 3 deletions src/item/enemy_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ fn statue_sub_spawners(statue: &Statue) -> Vec<(f32, EnemySubSpawner)> {
)],
Item::ScutumGlaciei => vec![
(
0.0,
10.0,
EnemySubSpawner {
statue: statue.clone(),
count: 10,
count: 5,
spawn_formation: SpawnFormation::Circle,
timer: Timer::from_seconds(0.25, TimerMode::Repeating),
..default()
},
),
(
10.0,
0.0,
EnemySubSpawner {
statue: statue.clone(),
count: 5,
Expand All @@ -92,6 +92,50 @@ fn statue_sub_spawners(statue: &Statue) -> Vec<(f32, EnemySubSpawner)> {
},
),
],
Item::AerTracto => vec![(
0.0,
EnemySubSpawner {
statue: statue.clone(),
count: 10,
spawn_formation: SpawnFormation::Random,
timer: Timer::from_seconds(0.3, TimerMode::Repeating),
..default()
},
)],
Item::AerPello => vec![(
1.0,
EnemySubSpawner {
statue: statue.clone(),
count: 15,
spawn_formation: SpawnFormation::Group,
timer: Timer::from_seconds(0.0, TimerMode::Repeating),
..default()
},
)],
Item::FulgurAvis => vec![
(
5.0,
EnemySubSpawner {
statue: statue.clone(),
count: 10,
spawn_formation: SpawnFormation::Circle,
offset: 100.0,
timer: Timer::from_seconds(0.0, TimerMode::Repeating),
..default()
},
),
(
0.0,
EnemySubSpawner {
statue: statue.clone(),
count: 20,
spawn_formation: SpawnFormation::Random,
offset: 300.0,
timer: Timer::from_seconds(0.1, TimerMode::Repeating),
..default()
},
),
],
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/item/item_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ pub fn item_title(item: &Item) -> String {
Item::InfernoPila => "UNLOCKED SPELL: Inferno Pila",
Item::Fulgur => "UNLOCKED SPELL: Fulgur",
Item::ScutumGlaciei => "UNLOCKED SPELL: Scutum Glaciei",
Item::AerTracto => "UNLOCKED SPELL: Aer Tracto",
Item::AerPello => "UNLOCKED SPELL: Aer Pello",
Item::FulgurAvis => "UNLOCKED SPELL: Fulgur Avis",
};
text.to_string()
}
Expand All @@ -24,6 +27,9 @@ pub fn item_description(item: &Item) -> String {
"Call down lightning strikes on random enemies.\nOnly works when there are enemies."
}
Item::ScutumGlaciei => "Materialize 10 ice crystals that cycle around you for 10 seconds.",
Item::AerTracto => "Pull enemies towards you.",
Item::AerPello => "Push enemies away from you.",
Item::FulgurAvis => "Summon a powerful lightning bird.",
};
text.to_string()
}
6 changes: 6 additions & 0 deletions src/item/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ pub enum Item {
InfernoPila,
Fulgur,
ScutumGlaciei,
AerTracto,
AerPello,
FulgurAvis,
}

impl Item {
Expand All @@ -33,6 +36,9 @@ impl Item {
"InfernoPila" => Item::InfernoPila,
"Fulgur" => Item::Fulgur,
"ScutumGlaciei" => Item::ScutumGlaciei,
"AerTracto" => Item::AerTracto,
"AerPello" => Item::AerPello,
"FulgurAvis" => Item::FulgurAvis,
_ => Item::NotImplemented,
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fn main() {
primary_window: Some(Window {
present_mode: PresentMode::Fifo,
mode: WindowMode::Windowed,
fit_canvas_to_parent: true,
..default()
}),
..default()
Expand Down

0 comments on commit fd4e551

Please sign in to comment.