-
Notifications
You must be signed in to change notification settings - Fork 0
/
mine-entrance.c
144 lines (125 loc) · 3.6 KB
/
mine-entrance.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// Graeber2 - an digger adventure game
//
// Copyright (C) 2021 Heiko Wolf
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License As published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY Or FITNESS For A PARTICULAR PURPOSE. See the
// GNU General Public License For more details.
//
// You should have received a copy of the GNU General Public License along
// With this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// Contact: projekte@kabelmail.net
#include "mine-entrance.h"
#include "engine.h"
#include "environment.h"
#include "hud.h"
#include "text.h"
#include "items.h"
#include "player.h"
#include "shops.h"
#include "lvlstatus.h"
#include "data/level/lvldatmine-entrance.h"
#include "data/level/lvldatfirstcourse.h"
#include "data/text/shields/shieldtxt.h"
#include "data/text/npcs/bosstxt.h"
#include "data/text/locations/locations.h"
///procedure for lvl0a
void p_lvl0a (void) __banked
{
//shield
p_environment_shield (191, shieldhealertxt);
p_shop_healer ();
//npcs
if ((o_player.mk == 134) || (o_player.mk == 117) ||
(o_player.mk == 98) || (o_player.mk == 115))
{
if (v_lvldat [0] == 0) {
p_set_txt (1, 1, bosstxtA1);
waitpad (J_DOWN);
p_set_txt (1, 1, bosstxtA2);
waitpad (J_DOWN);
p_set_txt (1, 1, bosstxtA3);
o_pickaxe.v_active = true;
o_player.inventory.pickaxe = true;
waitpad (J_A);
p_hide_txt ();
v_lvlmodi [0] = 1; v_lvldat [0] = 1;
p_player_set_weapon_sprite ();
p_hud_show_tool_status ();
}
}
//lvl changes
if (o_player.mk == 108) {
p_engine_load_map (lvl0b, BANK_5, BANK_3);
p_engine_change_lvl (-3, 152, o_player.yk);
}
else if (o_player.mk == 125) {
p_engine_load_map (lvl0c, BANK_5, BANK_3);
p_engine_change_lvl (-2, 16, o_player.yk);
}
else if (o_player.mk == 8) {
p_engine_load_map (lvl0d, BANK_5, BANK_3);
p_engine_change_lvl (-1, o_player.xk, 128);
}
}
///procedure for lvl0b
void p_lvl0b (void) __banked
{
//npcs
p_shop_food ();
p_shop_bombs ();
//shields
p_environment_shield (133, shieldfoodtxt);
p_environment_shield (123, shieldbombstxt);
//level change
if (o_player.mk == 125) {
p_engine_load_map (lvl0a, BANK_5, BANK_3);
p_engine_change_lvl (-4, 16, o_player.yk);
}
}
///procedure for lvl0c
void p_lvl0c (void) __banked
{
//npc
p_shop_beer ();
p_shop_whetstone ();
//shields
p_environment_shield (136, forgetxt);
p_environment_shield (110, shieldpubtxt);
p_environment_shield (228, shieldoiltxt);
//lvl change
if (o_player.mk == 108) {
p_engine_load_map (lvl0a, BANK_5, BANK_3);
p_engine_change_lvl (-4, 152, o_player.yk);
}
}
///procedure for lvl0d
void p_lvl0d (void) __banked
{
//shields
p_environment_shield (45, shieldfirstcoursetxt);
p_environment_shield (50, shieldsecondcoursetxt);
p_environment_shield (41, shieldthirdcoursetxt);
p_environment_shield (160, shieldfourthcoursetxt);
p_environment_shield (109, shieldfifthcoursetxt);
//level change
if (o_player.mk == 242) {
p_engine_load_map (lvl0a, BANK_5, BANK_3);
p_engine_change_lvl (-4, o_player.xk, 24);
}
else if (o_player.mk == 8) {
p_engine_load_map (lvl001, BANK_5, BANK_3);
p_engine_change_lvl (1, o_player.xk, 128);
o_engine.v_dungeontimer = 125;
p_hud_show_dungeontimer ();
p_show_location (firstcoursetxt);
}
}