| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef INCLUDED_BORG3_H |
| 5 |
#define INCLUDED_BORG3_H |
| 6 |
|
| 7 |
#include "angband.h" |
| 8 |
#include "obj-tval.h" |
| 9 |
#include "cave.h" |
| 10 |
#include "store.h" |
| 11 |
|
| 12 |
#ifdef ALLOW_BORG |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#include "borg1.h" |
| 19 |
|
| 20 |
|
| 21 |
extern void apw(void); |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#define ROW_SPELL 1 |
| 27 |
#define COL_SPELL 20+35 |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
typedef struct borg_item borg_item; |
| 36 |
typedef struct borg_shop borg_shop; |
| 37 |
|
| 38 |
enum { |
| 39 |
BORG_CURSE_UNKNOWN = 0, |
| 40 |
BORG_CURSE_VULNERABILITY = 1, |
| 41 |
BORG_CURSE_TELEPORTATION = 2, |
| 42 |
BORG_CURSE_DULLNESS = 3, |
| 43 |
BORG_CURSE_SICKLINESS = 4, |
| 44 |
BORG_CURSE_ENVELOPING = 5, |
| 45 |
BORG_CURSE_IRRITATION = 6, |
| 46 |
BORG_CURSE_WEAKNESS = 7, |
| 47 |
BORG_CURSE_CLUMSINESS = 8, |
| 48 |
BORG_CURSE_SLOWNESS = 9, |
| 49 |
BORG_CURSE_ANNOYANCE = 10, |
| 50 |
BORG_CURSE_POISON = 11, |
| 51 |
BORG_CURSE_SIREN = 12, |
| 52 |
BORG_CURSE_HALLUCINATION = 13, |
| 53 |
BORG_CURSE_PARALYSIS = 14, |
| 54 |
BORG_CURSE_DRAGON_SUMMON = 15, |
| 55 |
BORG_CURSE_DEMON_SUMMON = 16, |
| 56 |
BORG_CURSE_UNDEAD_SUMMON = 17, |
| 57 |
BORG_CURSE_IMPAIR_MANA_RECOVERY = 18, |
| 58 |
BORG_CURSE_IMPAIR_HITPOINT_RECOVERY = 19, |
| 59 |
BORG_CURSE_COWARDICE = 20, |
| 60 |
BORG_CURSE_STONE = 21, |
| 61 |
BORG_CURSE_ANTI_TELEPORTATION = 22, |
| 62 |
BORG_CURSE_TREACHEROUS_WEAPON = 23, |
| 63 |
BORG_CURSE_BURNING_UP = 24, |
| 64 |
BORG_CURSE_CHILLED_TO_THE_BONE = 25, |
| 65 |
BORG_CURSE_STEELSKIN = 26, |
| 66 |
BORG_CURSE_AIR_SWING = 27, |
| 67 |
BORG_CURSE_MAX = 28, |
| 68 |
}; |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
struct borg_item |
| 80 |
{ |
| 81 |
char desc[80]; |
| 82 |
|
| 83 |
char* note; |
| 84 |
|
| 85 |
uint32_t kind; |
| 86 |
|
| 87 |
bool ident; |
| 88 |
bool needs_ident; |
| 89 |
bool aware; |
| 90 |
|
| 91 |
bool xxxx; |
| 92 |
|
| 93 |
uint8_t tval; |
| 94 |
uint8_t sval; |
| 95 |
int16_t pval; |
| 96 |
|
| 97 |
uint8_t iqty; |
| 98 |
|
| 99 |
int16_t weight; |
| 100 |
|
| 101 |
uint8_t art_idx; |
| 102 |
uint8_t ego_idx; |
| 103 |
int activ_idx; |
| 104 |
bool one_ring; |
| 105 |
|
| 106 |
int16_t timeout; |
| 107 |
|
| 108 |
int16_t to_h; |
| 109 |
int16_t to_d; |
| 110 |
int16_t to_a; |
| 111 |
int16_t ac; |
| 112 |
uint8_t dd; |
| 113 |
uint8_t ds; |
| 114 |
|
| 115 |
uint8_t level; |
| 116 |
|
| 117 |
int32_t cost; |
| 118 |
|
| 119 |
int32_t value; |
| 120 |
|
| 121 |
bool cursed; |
| 122 |
bool uncursable; |
| 123 |
bool curses[BORG_CURSE_MAX]; |
| 124 |
|
| 125 |
bitflag flags[OF_SIZE]; |
| 126 |
int16_t modifiers[OBJ_MOD_MAX]; |
| 127 |
struct element_info el_info[ELEM_MAX]; |
| 128 |
bool brands[254]; |
| 129 |
|
| 130 |
int slays[RF_MAX]; |
| 131 |
}; |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
struct borg_shop |
| 138 |
{ |
| 139 |
|
| 140 |
|
| 141 |
int16_t xtra; |
| 142 |
|
| 143 |
int16_t page; |
| 144 |
int16_t more; |
| 145 |
|
| 146 |
borg_item ware[24]; |
| 147 |
}; |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
#define BORG_MAGIC_ICK 0 |
| 156 |
#define BORG_MAGIC_NOP 1 |
| 157 |
#define BORG_MAGIC_EXT 2 |
| 158 |
#define BORG_MAGIC_AIM 3 |
| 159 |
#define BORG_MAGIC_OBJ 4 |
| 160 |
#define BORG_MAGIC_WHO 5 |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
#define BORG_MAGIC_ICKY 0 |
| 168 |
#define BORG_MAGIC_LOST 1 |
| 169 |
#define BORG_MAGIC_HIGH 2 |
| 170 |
#define BORG_MAGIC_OKAY 3 |
| 171 |
#define BORG_MAGIC_TEST 4 |
| 172 |
#define BORG_MAGIC_KNOW 5 |
| 173 |
|
| 174 |
enum borg_spells |
| 175 |
{ |
| 176 |
MAGIC_MISSILE, |
| 177 |
LIGHT_ROOM, |
| 178 |
FIND_TRAPS_DOORS_STAIRS, |
| 179 |
PHASE_DOOR, |
| 180 |
ELECTRIC_ARC, |
| 181 |
DETECT_MONSTERS, |
| 182 |
FIRE_BALL, |
| 183 |
RECHARGING, |
| 184 |
IDENTIFY_RUNE, |
| 185 |
TREASURE_DETECTION, |
| 186 |
FROST_BOLT, |
| 187 |
REVEAL_MONSTERS, |
| 188 |
ACID_SPRAY, |
| 189 |
DISABLE_TRAPS_DESTROY_DOORS, |
| 190 |
TELEPORT_SELF, |
| 191 |
TELEPORT_OTHER, |
| 192 |
RESISTANCE, |
| 193 |
TAP_MAGICAL_ENERGY, |
| 194 |
MANA_CHANNEL, |
| 195 |
DOOR_CREATION, |
| 196 |
MANA_BOLT, |
| 197 |
TELEPORT_LEVEL, |
| 198 |
DETECTION, |
| 199 |
DIMENSION_DOOR, |
| 200 |
THRUST_AWAY, |
| 201 |
SHOCK_WAVE, |
| 202 |
EXPLOSION, |
| 203 |
BANISHMENT, |
| 204 |
MASS_BANISHMENT, |
| 205 |
MANA_STORM, |
| 206 |
DETECT_LIFE, |
| 207 |
FOX_FORM, |
| 208 |
REMOVE_HUNGER, |
| 209 |
STINKING_CLOUD, |
| 210 |
CONFUSE_MONSTER, |
| 211 |
SLOW_MONSTER, |
| 212 |
CURE_POISON, |
| 213 |
RESIST_POISON, |
| 214 |
TURN_STONE_TO_MUD, |
| 215 |
SENSE_SURROUNDINGS, |
| 216 |
LIGHTNING_STRIKE, |
| 217 |
EARTH_RISING, |
| 218 |
TRANCE, |
| 219 |
MASS_SLEEP, |
| 220 |
BECOME_PUKEL_MAN, |
| 221 |
EAGLES_FLIGHT, |
| 222 |
BEAR_FORM, |
| 223 |
TREMOR, |
| 224 |
HASTE_SELF, |
| 225 |
REVITALIZE, |
| 226 |
RAPID_REGENERATION, |
| 227 |
HERBAL_CURING, |
| 228 |
METEOR_SWARM, |
| 229 |
RIFT, |
| 230 |
ICE_STORM, |
| 231 |
VOLCANIC_ERUPTION, |
| 232 |
RIVER_OF_LIGHTNING, |
| 233 |
CALL_LIGHT, |
| 234 |
DETECT_EVIL, |
| 235 |
MINOR_HEALING, |
| 236 |
BLESS, |
| 237 |
SENSE_INVISIBLE, |
| 238 |
HEROISM, |
| 239 |
ORB_OF_DRAINING, |
| 240 |
SPEAR_OF_LIGHT, |
| 241 |
DISPEL_UNDEAD, |
| 242 |
DISPEL_EVIL, |
| 243 |
PROTECTION_FROM_EVIL, |
| 244 |
REMOVE_CURSE, |
| 245 |
PORTAL, |
| 246 |
REMEMBRANCE, |
| 247 |
WORD_OF_RECALL, |
| 248 |
HEALING, |
| 249 |
RESTORATION, |
| 250 |
CLAIRVOYANCE, |
| 251 |
ENCHANT_WEAPON, |
| 252 |
ENCHANT_ARMOUR, |
| 253 |
SMITE_EVIL, |
| 254 |
GLYPH_OF_WARDING, |
| 255 |
DEMON_BANE, |
| 256 |
BANISH_EVIL, |
| 257 |
WORD_OF_DESTRUCTION, |
| 258 |
HOLY_WORD, |
| 259 |
SPEAR_OF_OROME, |
| 260 |
LIGHT_OF_MANWE, |
| 261 |
NETHER_BOLT, |
| 262 |
CREATE_DARKNESS, |
| 263 |
BAT_FORM, |
| 264 |
READ_MINDS, |
| 265 |
TAP_UNLIFE, |
| 266 |
CRUSH, |
| 267 |
SLEEP_EVIL, |
| 268 |
SHADOW_SHIFT, |
| 269 |
DISENCHANT, |
| 270 |
FRIGHTEN, |
| 271 |
VAMPIRE_STRIKE, |
| 272 |
DISPEL_LIFE, |
| 273 |
DARK_SPEAR, |
| 274 |
WARG_FORM, |
| 275 |
BANISH_SPIRITS, |
| 276 |
ANNIHILATE, |
| 277 |
GRONDS_BLOW, |
| 278 |
UNLEASH_CHAOS, |
| 279 |
FUME_OF_MORDOR, |
| 280 |
STORM_OF_DARKNESS, |
| 281 |
POWER_SACRIFICE, |
| 282 |
ZONE_OF_UNMAGIC, |
| 283 |
VAMPIRE_FORM, |
| 284 |
CURSE, |
| 285 |
COMMAND, |
| 286 |
SINGLE_COMBAT, |
| 287 |
OBJECT_DETECTION, |
| 288 |
DETECT_STAIRS, |
| 289 |
HIT_AND_RUN, |
| 290 |
COVER_TRACKS, |
| 291 |
CREATE_ARROWS, |
| 292 |
DECOY, |
| 293 |
BRAND_AMMUNITION, |
| 294 |
SEEK_BATTLE, |
| 295 |
BERSERK_STRENGTH, |
| 296 |
WHIRLWIND_ATTACK, |
| 297 |
SHATTER_STONE, |
| 298 |
LEAP_INTO_BATTLE, |
| 299 |
GRIM_PURPOSE, |
| 300 |
MAIM_FOE, |
| 301 |
HOWL_OF_THE_DAMNED, |
| 302 |
RELENTLESS_TAUNTING, |
| 303 |
VENOM, |
| 304 |
WEREWOLF_FORM, |
| 305 |
BLOODLUST, |
| 306 |
UNHOLY_REPRIEVE, |
| 307 |
FORCEFUL_BLOW, |
| 308 |
QUAKE |
| 309 |
}; |
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
typedef struct borg_spell_rating borg_spell_rating; |
| 315 |
struct borg_spell_rating |
| 316 |
{ |
| 317 |
const char* name; |
| 318 |
uint8_t rating; |
| 319 |
enum borg_spells spell_enum; |
| 320 |
}; |
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
typedef struct borg_magic borg_magic; |
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
struct borg_magic |
| 332 |
{ |
| 333 |
const char* name; |
| 334 |
uint8_t status; |
| 335 |
uint16_t effect_index; |
| 336 |
uint8_t rating; |
| 337 |
uint8_t level; |
| 338 |
uint8_t power; |
| 339 |
uint8_t sfail; |
| 340 |
int book_offset; |
| 341 |
int book; |
| 342 |
int32_t times; |
| 343 |
enum borg_spells spell_enum; |
| 344 |
}; |
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
extern borg_item* borg_items; |
| 353 |
extern borg_shop* borg_shops; |
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
extern borg_item* safe_items; |
| 361 |
extern borg_item* safe_home; |
| 362 |
|
| 363 |
extern borg_shop* safe_shops; |
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
extern borg_magic* borg_magics; |
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
extern int borg_wield_slot(const borg_item* item); |
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
extern void borg_item_analyze(borg_item* item, const struct object* real_item, char* desc, bool in_store); |
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
extern bool borg_object_fully_id(void); |
| 388 |
|
| 389 |
|
| 390 |
extern bool borg_object_fully_id_aux(borg_item* borg_item, struct object* real_item); |
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
extern void borg_send_inscribe(int i, char* str); |
| 396 |
extern void borg_send_deinscribe(int i); |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
extern int borg_slot(int tval, int sval); |
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
enum borg_need { |
| 407 |
BORG_NO_NEED, |
| 408 |
BORG_MET_NEED, |
| 409 |
BORG_UNMET_NEED, |
| 410 |
}; |
| 411 |
extern enum borg_need borg_maintain_light(void); |
| 412 |
extern bool borg_refuel_lantern(void); |
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
extern bool borg_obj_has_effect(uint32_t kind, int index, int subtype); |
| 418 |
extern bool borg_eat_food(int tval, int sval); |
| 419 |
extern bool borg_quaff_crit(bool no_check); |
| 420 |
extern bool borg_quaff_potion(int sval); |
| 421 |
extern bool borg_eat_unknown(void); |
| 422 |
extern bool borg_use_unknown(void); |
| 423 |
extern bool borg_quaff_unknown(void); |
| 424 |
extern bool borg_read_unknown(void); |
| 425 |
extern bool borg_read_scroll(int sval); |
| 426 |
extern bool borg_equips_rod(int sval); |
| 427 |
extern bool borg_zap_rod(int sval); |
| 428 |
extern bool borg_aim_wand(int sval); |
| 429 |
extern bool borg_use_staff(int sval); |
| 430 |
extern bool borg_use_staff_fail(int sval); |
| 431 |
extern bool borg_equips_staff_fail(int sval); |
| 432 |
extern bool borg_inscribe_food(void); |
| 433 |
|
| 434 |
extern int borg_activate_failure(int tval, int sval); |
| 435 |
|
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
extern bool borg_activate_item(int activation); |
| 440 |
extern bool borg_equips_item(int activation, bool check_charge); |
| 441 |
extern bool borg_activate_dragon(int drag_sval); |
| 442 |
extern bool borg_equips_dragon(int drag_sval); |
| 443 |
extern bool borg_activate_ring(int ring_sval); |
| 444 |
extern bool borg_equips_ring(int ring_sval); |
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
extern int borg_spell_stat(void); |
| 451 |
extern bool borg_spell_legal(const enum borg_spells spell); |
| 452 |
extern bool borg_spell_okay(const enum borg_spells spell); |
| 453 |
extern int borg_get_spell_power(const enum borg_spells spell); |
| 454 |
extern int borg_get_book_num(int sval); |
| 455 |
extern borg_magic* borg_get_spell_entry(int book, int what); |
| 456 |
extern bool borg_spell(const enum borg_spells spell); |
| 457 |
extern bool borg_spell_fail(const enum borg_spells spell, int allow_fail); |
| 458 |
extern bool borg_spell_okay_fail(const enum borg_spells spell, int allow_fail); |
| 459 |
extern bool borg_spell_legal_fail(const enum borg_spells spell, int allow_fail); |
| 460 |
extern int borg_spell_fail_rate(const enum borg_spells spell); |
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
extern void borg_cheat_equip(void); |
| 467 |
extern void borg_cheat_inven(void); |
| 468 |
extern void borg_cheat_store(void); |
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
extern void borg_cheat_spell(int book); |
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
extern void borg_prepare_race_class_info(void); |
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
extern const char* borg_get_note(const borg_item* item); |
| 484 |
extern bool borg_item_note_needs_id(const borg_item* item); |
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
extern int borg_first_empty_inventory_slot(void); |
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
extern void borg_init_3(void); |
| 495 |
|
| 496 |
|
| 497 |
#endif |
| 498 |
|
| 499 |
#endif |
| 500 |
|