mirror of
https://github.com/zoriya/ForecastingVillage.git
synced 2026-06-07 12:15:31 +00:00
Adding a chest for the water jet
This commit is contained in:
@@ -75,6 +75,8 @@ gc_vector2 pos, enum gc_mousekeys key);
|
||||
void fisherman_setup(gc_engine *engine);
|
||||
bool fisherman_next(gc_engine *engine, gc_entity *entity, \
|
||||
gc_vector2 pos, enum gc_mousekeys key);
|
||||
bool fisherman_chest(gc_engine *engine, gc_entity *entity, \
|
||||
gc_vector2 pos, enum gc_mousekeys key);
|
||||
|
||||
bool lumberjack_yes(gc_engine *engine, gc_entity *entity, \
|
||||
gc_vector2 pos, enum gc_mousekeys key);
|
||||
|
||||
@@ -264,6 +264,18 @@
|
||||
</dialog_holder>
|
||||
</gc_entity>
|
||||
|
||||
<gc_entity>
|
||||
<transform_component>
|
||||
<Position x="0" y="0" />
|
||||
<Size x="50" y="50" />
|
||||
</transform_component>
|
||||
<renderer src="chest"/>
|
||||
<map_linker x="49" y="56" centered="true" />
|
||||
<dialog_holder x="48" y="56" tile_texture="npc_interact">
|
||||
<Chest line="You found a chest." callback="fisherman_chest" />
|
||||
</dialog_holder>
|
||||
</gc_entity>
|
||||
|
||||
<gc_entity>
|
||||
<transform_component>
|
||||
<Position x="0" y="0" />
|
||||
|
||||
@@ -60,6 +60,7 @@ const struct gc_data game_data[] = {
|
||||
{"dialog_callback", "mia_setup", &mia_setup, NULL},
|
||||
{"input", "fisherman_next", &fisherman_next, NULL},
|
||||
{"dialog_callback", "fisherman_setup", &fisherman_setup, NULL},
|
||||
{"dialog_callback", "fisherman_chest", &fisherman_chest, NULL},
|
||||
{"input", "lumberjack_yes", &lumberjack_yes, NULL},
|
||||
{"dialog_callback", "smith_chest", &smith_chest, NULL},
|
||||
{NULL, NULL, NULL, NULL}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "components/dialog_holder.h"
|
||||
#include "systems/game_manager_system.h"
|
||||
#include "components/player_component.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
@@ -37,4 +38,25 @@ that I will show up at...", NULL);
|
||||
dialog_add_line(dialog, "Fisherman", "her house for dinner tonight.", NULL);
|
||||
GETSYS(engine, game_manager_system)->has_message = true;
|
||||
return (true);
|
||||
}
|
||||
|
||||
bool fisherman_chest(gc_engine *engine, gc_entity *entity, \
|
||||
gc_vector2 pos, enum gc_mousekeys key)
|
||||
{
|
||||
struct dialog_holder *dialog = dialog_get_current(engine);
|
||||
gc_entity *player = engine->scene->get_entity(engine->scene, 50);
|
||||
struct player_component *inv;
|
||||
|
||||
if (!player)
|
||||
return (false);
|
||||
inv = GETCMP(player, player_component);
|
||||
if (!inv)
|
||||
return (false);
|
||||
dialog->text[1] = NULL;
|
||||
if (inv->inventory_upgrades[1])
|
||||
dialog_add_line(dialog, NULL, "This chest is empty.", NULL);
|
||||
else
|
||||
dialog_add_line(dialog, "", "You found the water jet upgrade!", NULL);
|
||||
inv->inventory_upgrades[1] = true;
|
||||
return (true);
|
||||
}
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
** smith.c
|
||||
*/
|
||||
|
||||
#include <components/player_component.h>
|
||||
#include <components/dialog_holder.h>
|
||||
#include "components/player_component.h"
|
||||
#include "components/dialog_holder.h"
|
||||
#include "engine.h"
|
||||
|
||||
bool smith_chest(gc_engine *engine, gc_entity *entity, \
|
||||
|
||||
Reference in New Issue
Block a user