mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 20:35:02 +01:00
Item give command, define panzerium as item
This commit is contained in:
parent
4dfb0ff7d7
commit
5f7924b696
5 changed files with 30 additions and 2 deletions
12
src/app.rs
12
src/app.rs
|
|
@ -18,7 +18,7 @@ use crate::{
|
|||
game::{for_each_tile_on_screen, Biome, GameState},
|
||||
graphics::{self, ScreenSc, ScreenVec},
|
||||
input::Input,
|
||||
inventory::{TileLayer, UseAction},
|
||||
inventory::{ItemId, Slot, TileLayer, UseAction},
|
||||
math::{center_offset, TILE_SIZE},
|
||||
res::Res,
|
||||
CliArgs,
|
||||
|
|
@ -404,6 +404,16 @@ impl App {
|
|||
Cmd::TeleportPlayerSpawn => {
|
||||
self.game.world.player.col_en.en.pos = self.game.spawn_point.to_s2dc()
|
||||
}
|
||||
Cmd::GiveItemByName(name) => {
|
||||
for (i, item) in self.game.itemdb.db.iter().enumerate() {
|
||||
if item.name == name {
|
||||
self.game.inventory.slots.push(Slot {
|
||||
id: i as ItemId,
|
||||
qty: 1,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue