#include <stdio.h>
#define DLGCOUNT 15
+
+#define PROMEMAXHP 262144
+#define PLAYERMAXHP 524288
+#define PROMEIMGPATH "dialogue-img/aichan-default.png" //REPLACE LATER!!
+#define BRICKCOOLDOWNFULL 5
+#define SKILLCOUNT 1
+#define DEFAULTANIMFRAME "dialogue-img/aichan-default.png" //REPLACE LATER--this is the default image in the animation window, should be Ai holding the banhammer
+
+//int player_atk = 64; //may seem little but. the whole point is to spam. also itll go up later
+//int brick_atk = 1024;
+int prome_atk = 256;
+int prome_atk_time = 0.2;
+
+struct sp_attack {
+ int keybind;
+ char *keybind_str;
+ char *filename;
+ char *atkspritesheet; //spritesheet :D (320x240)
+ int animframes; //yeah default to 1
+ float framelength; //in seconds
+ int atk;
+ float cooldown_left;
+ float cooldown_max;
+ int enabled;
+};
//really shouldnt do this all in here but idc
+static struct sp_attack skills[SKILLCOUNT] = {
+ { inputs[4], GetKeyName(inputs[4]), "dialogue-img/aichan-default.png", "dialogue-img/aichan-default.png", 1, 0.1, 64, 0, 0, 1}
+ { KEY_ONE, "1", "dialogue-img/brick.png", "img/brickatk/sheet.png", 3, 0.2, 1024,0,5,0},
+};
+
+
static struct dialogue dialogues[DLGCOUNT] = {
{"It's time to have an epic idol fight!!", "Rozaliya", "dialogue-img/aichan-default.png", PINK},
{"Roza... is this really a good idea?", "Liliya", "dialogue-img/aichan-default.png", BLUE},
struct dialogue *pre_dialogue = dialogues;
int pre_dialogue_count = 9;
-struct dialogue *post_dialogue_win = dialogues+9;
-int post_dialogue_win_count = 2;
+struct dialogue *post_win_dialogue = dialogues+9;
+int post_win_dialogue_count = 2;
-int prome_hp = 262144; //2^18
-int player_hp = 524288; //2^19
+int prome_hp = PROMEMAXHP; //2^18
+int player_hp = PLAYERMAXHP; //2^19
int player_atk = 64; //may seem little but. the whole point is to spam. also itll go up later
int brick_atk = 1024;
int prome_atk = 256;
int prome_atk_time = 0.2;
+int brick_cooldown = 0;
+//static functions
+static int draw_fight_screen(void);
int update_boss_screen(float delta)
{
switch (frozen) {
case 1: //pre-fight dialogue
drawdialogue(pre_dialogue+current_dlg);
- if (IsKeyPressed(inputs[5])) {
+ if (IsKeyPressed(inputs[5]) || IsKeyPressed(inputs[4])) {
if (++current_dlg >= pre_dialogue_count) { //dialogue over
current_dlg = 0;
frozen = 0;
break;
case 0:
//fight
+ draw_fight_screen();
break;
case 2:
//post-fight-win dialogue
+ drawdialogue(post_win_dialogue+current_dlg);
+ if (IsKeyPressed(inputs[5]) || IsKeyPressed(inputs[4])) {
+ if (++current_dlg >= post_win_dialogue_count) { //dialogue over
+ current_dlg = 0;
+ frozen = 0;
+ mode = ENDSCREENMODE;
+ };
+ };
break;
case 3:
//post-fight-lose dialogue
};
return 1;
};
+
+static int draw_hp_bar(int hp, int max_hp, Vector2 position);
+static int draw_enemy_img(char *filename);
+static int draw_sp_attack(int cooldown_left, int cooldown_max, char *img_filename, char *keybind);
+
+static int draw_fight_screen(void)
+{
+ //so like draw the enemy display for a bit
+ DrawText("\"Context\"??:", 80,45,30,BLACK); //enemy name :)
+ draw_hp_bar(prome_hp,PROMEMAXHP, (Vector2){300,40});
+ draw_enemy_img(PROMEIMGPATH);
+
+ return 1;
+};
+
+static int draw_hp_bar(int hp, int max_hp, Vector2 pos)
+{
+ int percent = (float)hp/(float)max_hp * 100;
+ int hp_width = (float)hp/(float)max_hp * 300;
+ //ok so i think green for HP, red for used up HP, black for the border would be good?
+ Vector2 bar_size = {300,40};
+ //draw the background
+ DrawRectangleV(pos, bar_size, RED);
+ //draw the hp the character has. i think. 3px/percentage btw
+ DrawRectangleV(pos, (Vector2){hp_width,40}, GREEN);
+ //draw the outline!!
+ DrawRectangleLinesEx((Rectangle){pos.x, pos.y, bar_size.x, bar_size.y}, 2, BLACK);
+ //draw
+
+ return 1;
+};
+
+Texture2D txtr;
+
+static int draw_enemy_img(char *filename)
+{
+ static char *last_filename = "";
+ if (filename != last_filename) {
+ printf("time to reimport the image");
+ Image img = LoadImage(filename);
+ ImageResize(&img,280,360);
+ txtr = LoadTextureFromImage(img);
+ UnloadImage(img);
+ last_filename = filename;
+ };
+ DrawTexture(txtr,0,120,WHITE);
+ return 1;
+};
+
+int fight_cleanup(void)
+{
+ UnloadTexture(txtr);
+ return 1;
+};
+