aboutsummaryrefslogtreecommitdiffstats
path: root/src/gameplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gameplay.cpp')
-rw-r--r--src/gameplay.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index 1670929..7dbe98e 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -28,6 +28,10 @@ void story(Mob *callee){
callee->alive = false;
}
+/*
+ * Gens
+ */
+
float gen_worldSpawnHill1(float x){
return (float)(pow(2,(-x+200)/5) + GEN_MIN);
}
@@ -42,7 +46,6 @@ float gen_worldSpawnHill3(float x){
*/
void worldSpawnHill1_hillBlock(Mob *callee){
- std::cout<<"oi";
player->vel.x = 0;
player->loc.x = callee->loc.x + callee->width;
ui::dialogBox(player->name,NULL,false,"This hill seems to steep to climb up...");
@@ -52,7 +55,7 @@ void worldSpawnHill1_hillBlock(Mob *callee){
static Arena *a;
void worldSpawnHill2_infoSprint(Mob *callee){
- ui::dialogBox(player->name,":Nah:Sure",false,"This page would like to take you somewhere.");
+ ui::dialogBox(player->name,":Sure:Nah",false,"This page would like to take you somewhere.");
ui::waitForDialog();
switch(ui::dialogOptChosen){
case 1:
@@ -75,19 +78,22 @@ void worldSpawnHill2_infoSprint(Mob *callee){
//ui::dialogBox("B-) ",NULL,true,"Press \'Shift\' to run!");
}
-void worldSpawnHill3_itemGet(Mob *callee){
- ui::dialogBox("B-) ",NULL,true,"Right click to pick up items!");
- callee->alive = false;
-}
-
-void worldSpawnHill3_itemSee(Mob *callee){
- ui::dialogBox("B-) ",NULL,true,"Press \'e\' to open your inventory!");
- callee->alive = false;
+int worldSpawnHill2_Quest2(NPC *callee){
+ ui::dialogBox(callee->name,NULL,false,"Yo.");
+ ui::waitForDialog();
+ return 0;
}
-void worldSpawnHill3_leave(Mob *callee){
- ui::dialogBox("B-) ",NULL,true,"Now jump in this hole, and let your journey begin :)");
- callee->alive = false;
+int worldSpawnHill2_Quest1(NPC *callee){
+ ui::dialogBox(callee->name,":Cool.",false,"Did you know that I\'m the coolest NPC in the world?");
+ ui::waitForDialog();
+ if(ui::dialogOptChosen == 1){
+ ui::dialogBox(callee->name,NULL,false,"Yeah, it is.");
+ currentWorld->getAvailableNPC()->addAIFunc(worldSpawnHill2_Quest2,true);
+ ui::waitForDialog();
+ return 0;
+ }
+ return 1;
}
/*
@@ -132,10 +138,6 @@ void initEverything(void){
worldSpawnHill3->generateFunc(1000,gen_worldSpawnHill3);
worldSpawnHill3->setBackground(BG_FOREST);
worldSpawnHill3->setBGM("assets/music/ozone.wav");
- worldSpawnHill3->addMob(MS_TRIGGER,-500,0,worldSpawnHill3_itemGet);
- worldSpawnHill3->addMob(MS_TRIGGER,0,0,worldSpawnHill3_itemSee);
- worldSpawnHill3->addObject(TEST_ITEM,false,"",-200,300);
- worldSpawnHill3->addMob(MS_TRIGGER,650,0,worldSpawnHill3_leave);
worldSpawnHill3->addHole(800,1000);
worldSpawnHill1->toRight = worldSpawnHill2;
@@ -162,6 +164,7 @@ void initEverything(void){
worldSpawnHill2_Building1->setBGM("assets/music/theme_jazz.wav");
worldSpawnHill2->addStructure(STRUCTURET,HOUSE,(rand()%120*HLINE),100,worldSpawnHill2_Building1);
+ worldSpawnHill2->getAvailableNPC()->addAIFunc(worldSpawnHill2_Quest1,false);
player = new Player();
player->spawn(200,100);