Game For ECE 2035

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Revision:
14:7225da81314a
Parent:
13:798a4dd14c7e
Child:
15:05592aaa468c
--- a/actions.cpp	Thu Dec 02 20:16:28 2021 +0000
+++ b/actions.cpp	Fri Dec 03 08:45:49 2021 +0000
@@ -95,6 +95,116 @@
     horizontal_speech1(line3,line4);
 }
 
+void merch_speech1(){
+    char line1[] = "Welcome To";
+    char line2[] = "The Shop";
+    horizontal_speech1(line1,line2);
+
+    char line3[] = "Take a look";
+    char line4[] = "My Friend";
+    horizontal_speech1(line3,line4);
+    }
+    
+    void merch_speech2(){
+    char line1[] = "Thank You";
+    char line2[] = "For Shopping";
+    horizontal_speech1(line1,line2);
+
+    char line3[] = "Be sure to";
+    char line4[] = "Return :)";
+    horizontal_speech1(line3,line4);
+    }
+    
+    void cantbuy()
+{
+    char line1[] = "Not Enough";
+    char line2[] = "Funds";
+    horizontal_speech1(line1,line2);
+}
+
+void frt()
+{
+    char line1[] = "HP:";
+    char line2[] = "+6";
+    horizontal_speech2(line1,line2);
+}
+
+void elx()
+{
+    char line1[] = "HP:";
+    char line2[] = "+10";
+    horizontal_speech2(line1,line2);
+}
+
+void poti()
+{
+    char line1[] = "MP:";
+    char line2[] = "+8";
+    horizontal_speech2(line1,line2);
+}
+
+void npc2_speech()
+{
+    char line1[] = "*Twink Twink*";
+    char line2[] = "*Twink Twink*";
+    horizontal_speech1(line1,line2);
+
+    char line3[] = "Please save us";
+    char line4[] = "Mighty Hero";
+    horizontal_speech1(line3,line4);
+}
+
+void fire_dmg(){
+    char line1[] = "*Burn Burn*";
+    char line2[] = "*Crackle*";
+    horizontal_speech1(line1,line2);
+
+    char line3[] = "Fire Damage:";
+    char line4[] = "HP: -2";
+    horizontal_speech1(line3,line4);
+    }
+    
+void eye_dmg(){
+    char line1[] = "*shake shake*";
+    char line2[] = "Recoiled";
+    horizontal_speech1(line1,line2);
+    
+    char line3[] = "Eye Screeched!";
+    char line4[] = "The sound hurts";
+    horizontal_speech1(line3,line4);
+    
+    char line5[] = "HP Damage:";
+    char line6[] = "HP: -15";
+    horizontal_speech1(line5,line6);
+    }
+    
+void gob_dmg(){
+    char line1[] = "*shake shake*";
+    char line2[] = "Recoiled";
+    horizontal_speech1(line1,line2);
+    
+    char line3[] = "Goblin Attacked";
+    char line4[] = "Took Damage";
+    horizontal_speech1(line3,line4);
+
+    char line5[] = "HP Damage:";
+    char line6[] = "HP: -12";
+    horizontal_speech1(line5,line6);
+    }
+    
+
+    
+    void potion(){
+    char line1[] = "Potion:";
+    char line2[] = "Selected";
+    horizontal_speech1(line1,line2);
+
+    char line3[] = "MP increase";
+    char line4[] = "MP: +5";
+    horizontal_speech1(line3,line4);
+    }
+
+
 void npc_speech1()
 {
 
@@ -184,22 +294,34 @@
 
 }
 
+void money_chest()
+{
+    char line1[] = "Chest Open:";
+    char line2[] = "Oh La La $$";
+    horizontal_speech1(line1,line2);
+
+    char line3[] = "Money Gained:";
+    char line4[] = "+$2";
+    horizontal_speech1(line3,line4);
+}
+
 
 void init_dung()
 {
     Map* dung = set_active_map(1);
-    for(int i = map_width() + 9; i < map_area(); i += 15) {
-        add_chest(i % map_width(), i / map_width());
-    }
-    pc.printf("plants\r\n");
-
-    pc.printf("Adding walls!\r\n");
+    
     add_castle(0,              0,              HORIZONTAL, map_width());
     add_castle(0,              map_height()-1, HORIZONTAL, map_width());
     add_castle(0,              0,              VERTICAL,   map_height());
     add_castle(map_width()-1,  0,              VERTICAL,   map_height());
-    pc.printf("Walls done!\r\n");
 
+    add_chest(10,16);
+    add_chest(17,17);
+    add_chest(14,7);
+    add_chest(9,3);
+    add_chest(5,6);
+    add_chest(12,11);
+    add_chest(2,18);
 
     add_portal2(10,2);
 
@@ -208,6 +330,8 @@
     add_goblin(5,7,ENEMY2);
     
     add_goblin(10,10,ENEMY1);
+    
+    add_eye(15,15);
 
     print_map();