gitignore, spring cleaning
This commit is contained in:
parent
e937994439
commit
3e9ebaa002
5 changed files with 33 additions and 104 deletions
13
.gitignore
vendored
13
.gitignore
vendored
|
|
@ -1,6 +1,11 @@
|
||||||
/target
|
# Build files, documentation, benchmarks
|
||||||
.rustfmt.toml
|
target
|
||||||
|
docs/*
|
||||||
|
|
||||||
|
# VSCode/IDE config files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
docs/gifs/*
|
.rustfmt.toml
|
||||||
.savegames/*
|
.prettierignore
|
||||||
|
|
||||||
|
# Savegame
|
||||||
savegame.json
|
savegame.json
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
AOE { radius: i32 }
|
|
||||||
BlocksTile {}
|
|
||||||
CombatStats { max_hp: i32, hp: i32, defence: i32, power: i32 }
|
|
||||||
Confusion { turns: i32 }
|
|
||||||
Consumable {}
|
|
||||||
Cursed {}
|
|
||||||
DefenceBonus { amount: i32 }
|
|
||||||
Destructible {}
|
|
||||||
Equippable { slot: EquipmentSlot }
|
|
||||||
Equipped { owner: Entity, slot: EquipmentSlot }
|
|
||||||
HungerClock { state: HungerState, duration: i32 }
|
|
||||||
InBackpack { owner: Entity }
|
|
||||||
InflictsDamage { amount: i32 }
|
|
||||||
Item {}
|
|
||||||
MagicMapper {}
|
|
||||||
MeleePowerBonus { amount: i32 }
|
|
||||||
Mind {}
|
|
||||||
Monster {}
|
|
||||||
Name { name: String }
|
|
||||||
ParticleLifetime { lifetime_ms: f32 }
|
|
||||||
Player {}
|
|
||||||
Position { x: i32, y: i32}
|
|
||||||
ProvidesHealing { amount: i32 }
|
|
||||||
Ranged { range: i32 }
|
|
||||||
Renderable { glyph: rltk::FontCharType, fg: RGB, bg: RGB, render_order: i32 }
|
|
||||||
SufferDamage { amount: i32 }
|
|
||||||
Telepath { telepath_tiles: Vec<rltk::Point>, range: i32, dirty: bool }
|
|
||||||
Viewshed { visible_tiles: Vec<rltk::Point>, range: i32, dirty: bool }
|
|
||||||
WantsToDropItem { item: Entity }
|
|
||||||
WantsToMelee { target: Entity }
|
|
||||||
WantsToPickupItem { collected_by: Entity, item: Entity }
|
|
||||||
WantsToRemoveItem { item: Entity }
|
|
||||||
WantsToUseItem { item: Entity, target: Option<rltk::Point }
|
|
||||||
|
|
@ -54,9 +54,7 @@
|
||||||
"flags": ["BYSTANDER", "BLOCKS_TILE"],
|
"flags": ["BYSTANDER", "BLOCKS_TILE"],
|
||||||
"vision_range": 4,
|
"vision_range": 4,
|
||||||
"quips": ["You're not borrowing my pick."],
|
"quips": ["You're not borrowing my pick."],
|
||||||
"attacks": [
|
"attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d8" }]
|
||||||
{ "name": "hits", "hit_bonus": 0, "damage": "1d8"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "npc_guard",
|
"id": "npc_guard",
|
||||||
|
|
@ -66,9 +64,7 @@
|
||||||
"level": 2,
|
"level": 2,
|
||||||
"vision_range": 4,
|
"vision_range": 4,
|
||||||
"quips": ["You wont catch me down the mine.", "Staying out of trouble?"],
|
"quips": ["You wont catch me down the mine.", "Staying out of trouble?"],
|
||||||
"attacks": [
|
"attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d8" }],
|
||||||
{ "name": "hits", "hit_bonus": 0, "damage": "1d8"}
|
|
||||||
],
|
|
||||||
"equipped": ["equip_shortsword", "equip_body_leather"]
|
"equipped": ["equip_shortsword", "equip_body_leather"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -80,9 +76,7 @@
|
||||||
"bac": 6,
|
"bac": 6,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"quips": ["<woof!>", "<bark!>", "<grrr..>"],
|
"quips": ["<woof!>", "<bark!>", "<grrr..>"],
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d6" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d6"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "rat",
|
"id": "rat",
|
||||||
|
|
@ -91,9 +85,7 @@
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"bac": 6,
|
"bac": 6,
|
||||||
"vision_range": 8,
|
"vision_range": 8,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d2" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d2"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "chicken",
|
"id": "chicken",
|
||||||
|
|
@ -102,9 +94,7 @@
|
||||||
"flags": ["BYSTANDER", "BLOCKS_TILE"],
|
"flags": ["BYSTANDER", "BLOCKS_TILE"],
|
||||||
"bac": 8,
|
"bac": 8,
|
||||||
"vision_range": 4,
|
"vision_range": 4,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d3" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d3"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "chicken_little",
|
"id": "chicken_little",
|
||||||
|
|
@ -113,9 +103,7 @@
|
||||||
"flags": ["BYSTANDER", "BLOCKS_TILE"],
|
"flags": ["BYSTANDER", "BLOCKS_TILE"],
|
||||||
"bac": 10,
|
"bac": 10,
|
||||||
"vision_range": 4,
|
"vision_range": 4,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d2" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d2"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "rat_giant",
|
"id": "rat_giant",
|
||||||
|
|
@ -125,9 +113,7 @@
|
||||||
"level": 1,
|
"level": 1,
|
||||||
"bac": 7,
|
"bac": 7,
|
||||||
"vision_range": 8,
|
"vision_range": 8,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d3" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d3"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "dog",
|
"id": "dog",
|
||||||
|
|
@ -137,9 +123,7 @@
|
||||||
"level": 4,
|
"level": 4,
|
||||||
"bac": 5,
|
"bac": 5,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d6" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d6"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "dog_large",
|
"id": "dog_large",
|
||||||
|
|
@ -149,9 +133,7 @@
|
||||||
"level": 6,
|
"level": 6,
|
||||||
"bac": 4,
|
"bac": 4,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "2d4" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "2d4"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "goblin",
|
"id": "goblin",
|
||||||
|
|
@ -160,9 +142,7 @@
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"level": 1,
|
"level": 1,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d4" }]
|
||||||
{ "name": "hits", "hit_bonus": 0, "damage": "1d4"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "kobold",
|
"id": "kobold",
|
||||||
|
|
@ -171,9 +151,7 @@
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"level": 1,
|
"level": 1,
|
||||||
"vision_range": 7,
|
"vision_range": 7,
|
||||||
"attacks": [
|
"attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d4" }]
|
||||||
{ "name": "hits", "hit_bonus": 0, "damage": "1d4"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "jackal",
|
"id": "jackal",
|
||||||
|
|
@ -182,9 +160,7 @@
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"bac": 7,
|
"bac": 7,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d2" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d2"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "fox",
|
"id": "fox",
|
||||||
|
|
@ -193,9 +169,7 @@
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"bac": 7,
|
"bac": 7,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d3" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d3"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "coyote",
|
"id": "coyote",
|
||||||
|
|
@ -205,9 +179,7 @@
|
||||||
"level": 1,
|
"level": 1,
|
||||||
"bac": 7,
|
"bac": 7,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d4" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "1d4"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "wolf",
|
"id": "wolf",
|
||||||
|
|
@ -217,9 +189,7 @@
|
||||||
"level": 5,
|
"level": 5,
|
||||||
"bac": 4,
|
"bac": 4,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "2d4" }]
|
||||||
{ "name": "bites", "hit_bonus": 0, "damage": "2d4"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "goblin_chieftain",
|
"id": "goblin_chieftain",
|
||||||
|
|
@ -228,9 +198,7 @@
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"level": 2,
|
"level": 2,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d8" }]
|
||||||
{ "name": "hits", "hit_bonus": 0, "damage": "1d8"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "orc",
|
"id": "orc",
|
||||||
|
|
@ -238,9 +206,7 @@
|
||||||
"renderable": { "glyph": "o", "fg": "#00FF00", "bg": "#000000", "order": 1 },
|
"renderable": { "glyph": "o", "fg": "#00FF00", "bg": "#000000", "order": 1 },
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d6" }]
|
||||||
{ "name": "hits", "hit_bonus": 0, "damage": "1d6"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "orc_large",
|
"id": "orc_large",
|
||||||
|
|
@ -249,9 +215,7 @@
|
||||||
"flags": ["MONSTER", "BLOCKS_TILE"],
|
"flags": ["MONSTER", "BLOCKS_TILE"],
|
||||||
"level": 2,
|
"level": 2,
|
||||||
"vision_range": 12,
|
"vision_range": 12,
|
||||||
"attacks": [
|
"attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d6" }]
|
||||||
{ "name": "hits", "hit_bonus": 0, "damage": "1d6"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ogre",
|
"id": "ogre",
|
||||||
|
|
|
||||||
|
|
@ -67,21 +67,15 @@
|
||||||
{ "id": "kobold", "weight": 1, "difficulty": 1},
|
{ "id": "kobold", "weight": 1, "difficulty": 1},
|
||||||
{ "id": "fox", "weight": 1, "difficulty": 1},
|
{ "id": "fox", "weight": 1, "difficulty": 1},
|
||||||
{ "id": "jackal", "weight": 4, "difficulty": 1},
|
{ "id": "jackal", "weight": 4, "difficulty": 1},
|
||||||
|
{ "id": "rat_giant", "weight": 2, "difficulty": 2},
|
||||||
{ "id": "rat_giant", "weight": 2, "difficulty": 2},
|
|
||||||
{ "id": "coyote", "weight": 4, "difficulty": 2},
|
{ "id": "coyote", "weight": 4, "difficulty": 2},
|
||||||
|
|
||||||
{ "id": "dog_little", "weight": 1, "difficulty": 3},
|
{ "id": "dog_little", "weight": 1, "difficulty": 3},
|
||||||
{ "id": "orc", "weight": 2, "difficulty": 3},
|
{ "id": "orc", "weight": 2, "difficulty": 3},
|
||||||
{ "id": "orc_large", "weight": 1, "difficulty": 3},
|
{ "id": "orc_large", "weight": 1, "difficulty": 3},
|
||||||
{ "id": "goblin_chieftain", "weight": 1, "difficulty": 3},
|
{ "id": "goblin_chieftain", "weight": 1, "difficulty": 3},
|
||||||
|
|
||||||
{ "id": "ogre", "weight": 1, "difficulty": 4},
|
{ "id": "ogre", "weight": 1, "difficulty": 4},
|
||||||
|
|
||||||
{ "id": "dog", "weight": 1, "difficulty": 5},
|
{ "id": "dog", "weight": 1, "difficulty": 5},
|
||||||
|
|
||||||
{ "id": "wolf", "weight": 2, "difficulty": 6},
|
{ "id": "wolf", "weight": 2, "difficulty": 6},
|
||||||
|
|
||||||
{ "id": "dog_large", "weight": 1, "difficulty": 7}
|
{ "id": "dog_large", "weight": 1, "difficulty": 7}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,6 @@ impl<'a> System<'a> for DamageSystem {
|
||||||
let mut player_stats = stats.get_mut(*player).unwrap();
|
let mut player_stats = stats.get_mut(*player).unwrap();
|
||||||
let player_attributes = attributes.get(*player).unwrap();
|
let player_attributes = attributes.get(*player).unwrap();
|
||||||
player_stats.xp += xp_gain;
|
player_stats.xp += xp_gain;
|
||||||
rltk::console::log(xp_gain);
|
|
||||||
|
|
||||||
let mut next_level_requirement = -1;
|
let mut next_level_requirement = -1;
|
||||||
if player_stats.level < 10 {
|
if player_stats.level < 10 {
|
||||||
next_level_requirement = 20 * 2_i32.pow(player_stats.level as u32 - 1);
|
next_level_requirement = 20 * 2_i32.pow(player_stats.level as u32 - 1);
|
||||||
|
|
@ -70,7 +68,6 @@ impl<'a> System<'a> for DamageSystem {
|
||||||
} else if player_stats.level < 30 {
|
} else if player_stats.level < 30 {
|
||||||
next_level_requirement = 10000000 * (player_stats.level - 19);
|
next_level_requirement = 10000000 * (player_stats.level - 19);
|
||||||
}
|
}
|
||||||
|
|
||||||
if next_level_requirement != -1 && player_stats.xp >= next_level_requirement {
|
if next_level_requirement != -1 && player_stats.xp >= next_level_requirement {
|
||||||
// We've gone up a level!
|
// We've gone up a level!
|
||||||
player_stats.level += 1;
|
player_stats.level += 1;
|
||||||
|
|
@ -91,13 +88,14 @@ impl<'a> System<'a> for DamageSystem {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Roll for HP gain this level
|
||||||
let hp_gained = player_hp_per_level(
|
let hp_gained = player_hp_per_level(
|
||||||
&mut rng,
|
&mut rng,
|
||||||
player_attributes.constitution.base + player_attributes.constitution.modifiers,
|
player_attributes.constitution.base + player_attributes.constitution.modifiers,
|
||||||
);
|
);
|
||||||
player_stats.hit_points.max += hp_gained;
|
player_stats.hit_points.max += hp_gained;
|
||||||
player_stats.hit_points.current += hp_gained;
|
player_stats.hit_points.current += hp_gained;
|
||||||
|
// Roll for MANA gain this level
|
||||||
let mana_gained = mana_per_level(
|
let mana_gained = mana_per_level(
|
||||||
&mut rng,
|
&mut rng,
|
||||||
player_attributes.intelligence.base + player_attributes.intelligence.modifiers,
|
player_attributes.intelligence.base + player_attributes.intelligence.modifiers,
|
||||||
|
|
@ -106,7 +104,7 @@ impl<'a> System<'a> for DamageSystem {
|
||||||
player_stats.mana.current += mana_gained;
|
player_stats.mana.current += mana_gained;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Clear the queue
|
||||||
damage.clear();
|
damage.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,6 +144,7 @@ pub fn delete_the_dead(ecs: &mut World) {
|
||||||
}
|
}
|
||||||
dead.push(entity)
|
dead.push(entity)
|
||||||
}
|
}
|
||||||
|
// The player died, go to GameOver.
|
||||||
Some(_) => {
|
Some(_) => {
|
||||||
let mut runstate = ecs.write_resource::<RunState>();
|
let mut runstate = ecs.write_resource::<RunState>();
|
||||||
*runstate = RunState::GameOver;
|
*runstate = RunState::GameOver;
|
||||||
|
|
@ -154,7 +153,7 @@ pub fn delete_the_dead(ecs: &mut World) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// For everything that died, increment the event log, and delete.
|
||||||
for victim in dead {
|
for victim in dead {
|
||||||
gamelog::record_event("death_count", 1);
|
gamelog::record_event("death_count", 1);
|
||||||
ecs.delete_entity(victim).expect("Unable to delete.");
|
ecs.delete_entity(victim).expect("Unable to delete.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue