static void _cyclops_calc_bonuses(void) { res_add(RES_SOUND); }
static void _dark_elf_calc_bonuses(void) { res_add(RES_DARK); p_ptr->spell_cap += 3; if (p_ptr->lev >= 20) p_ptr->see_inv = TRUE; }
/**************************************************************** * Hephaestus ****************************************************************/ static void _hephaestus_calc_bonuses(void) { res_add(RES_DISEN); }
/****************************************************************************** * Troll Bonuses ******************************************************************************/ static void _calc_bonuses(void) { int l = p_ptr->lev; int to_a = l/10 + l*l/250 + l*l*l/12500; p_ptr->to_a += to_a; p_ptr->dis_to_a += to_a; p_ptr->regenerate = TRUE; /* cf process_world_aux_hp_and_sp() in dungeon.c for the troll's special regeneration */ switch (p_ptr->current_r_idx) { case MON_FOREST_TROLL: res_add_vuln(RES_LITE); break; case MON_STONE_TROLL: res_add_vuln(RES_LITE); break; case MON_ICE_TROLL: res_add_vuln(RES_LITE); res_add_vuln(RES_FIRE); res_add(RES_COLD); res_add(RES_COLD); break; case MON_FIRE_TROLL: res_add_vuln(RES_LITE); res_add_vuln(RES_COLD); res_add(RES_FIRE); res_add(RES_FIRE); break; case MON_ALGROTH: break; case MON_AKLASH: res_add(RES_POIS); res_add(RES_ACID); break; case MON_OLOG: res_add(RES_POIS); break; case MON_ETTIN: p_ptr->free_act = TRUE; res_add(RES_POIS); res_add(RES_CONF); break; case MON_SPIRIT_TROLL: p_ptr->pass_wall = TRUE; p_ptr->no_passwall_dam = TRUE; p_ptr->free_act = TRUE; p_ptr->see_inv = TRUE; p_ptr->levitation = TRUE; res_add(RES_COLD); res_add(RES_ELEC); res_add(RES_POIS); res_add(RES_CONF); break; case MON_STORM_TROLL: p_ptr->pspeed += 5; res_add(RES_COLD); res_add(RES_ELEC); res_add(RES_ACID); break; case MON_TROLL_KING: p_ptr->pspeed += 7; p_ptr->free_act = TRUE; res_add(RES_POIS); res_add(RES_CONF); break; } }
int main(int argc, char** argv) { SDL_Surface *screen=NULL; srand(time(NULL)); sdl_init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); sound_init(); font_init(); #ifdef GEKKO if (!fatInitDefault()) { printf("fatInitDefault failure: terminating\n"); exit(EXIT_FAILURE); } freopen("sd:/apps/bomberguy/out.txt", "w", stdout); freopen("sd:/apps/bomberguy/err.txt", "w", stderr); #endif // make sure SDL cleans up before exit atexit(SDL_Quit); SDL_ShowCursor(SDL_DISABLE); SDL_WM_SetCaption("bomberguy", NULL); // create a new window screen = sdl_set_video(SCREEN_WIDTH, SCREEN_HEIGHT, 16, SDL_HWSURFACE); if ( !screen ) { fprintf(stderr, "Unable to set video: %s\n", SDL_GetError()); exit(EXIT_FAILURE); } backbuffer = SDL_DisplayFormat(screen); //load ressources ressource* res_bomb = malloc(sizeof(ressource)); image* img_bomb = image_load("./res/bomb.png"); res_bomb->name = strdup("bomb"); res_bomb->data = img_bomb; image_set_transp_color(img_bomb, 255, 0, 255); images = res_add(images, res_bomb); ressource* res_flame = malloc(sizeof(ressource)); image* img_flame = image_load("./res/flame.png"); image_set_transp_color(img_flame, 255, 0, 255); res_flame->name = strdup("flame"); res_flame->data = img_flame; images = res_add(images, res_flame); ressource* res_block = malloc(sizeof(ressource)); image* img_block = image_load("./res/block_classic.png"); image_set_transp_color(img_block, 255, 0, 255); res_block->name = strdup("block"); res_block->data = img_block; images = res_add(images, res_block); //Some game default parameters g_game.block_fill = 0.65; g_game.time = 180; g_game.unit_nb = 2; unit_init(g_game.v_unit, UNIT_MAX); SDL_EnableKeyRepeat(10,10); state_main_menu(screen); SDL_Quit(); return EXIT_SUCCESS; }
static void _apollo_calc_bonuses(void) { res_add_immune(RES_LITE); res_add(RES_BLIND); /* cf calc_torch in xtra1.c for the 'extra light' */ }
static void _half_ogre_calc_bonuses(void) { res_add(RES_DARK); p_ptr->sustain_str = TRUE; }
static void _calc_bonuses(void) { if (p_ptr->innate_attack_info.xtra_blow > 0) p_ptr->innate_attack_info.xtra_blow = 0; /* Clay Golem */ p_ptr->to_a += 5; p_ptr->dis_to_a += 5; p_ptr->free_act = TRUE; p_ptr->hold_life = TRUE; res_add(RES_POIS); /* Stone Golem */ if (p_ptr->lev >= 10) { p_ptr->to_a += 5; p_ptr->dis_to_a += 5; res_add(RES_FEAR); } /* Iron Golem */ if (p_ptr->lev >= 20) { p_ptr->to_a += 10; p_ptr->dis_to_a += 10; p_ptr->see_inv = TRUE; res_add(RES_FIRE); res_add(RES_COLD); res_add(RES_ELEC); p_ptr->magic_resistance += 5; } /* Mithril Golem */ if (p_ptr->lev >= 30) { p_ptr->to_a += 10; p_ptr->dis_to_a += 10; p_ptr->pspeed -= 1; p_ptr->reflect = TRUE; res_add(RES_CONF); res_add(RES_SHARDS); p_ptr->magic_resistance += 5; } /* Eog Golem */ if (p_ptr->lev >= 40) { p_ptr->to_a += 10; /* +40 */ p_ptr->dis_to_a += 10; p_ptr->pspeed -= 1; p_ptr->magic_resistance += 5; /* 15% */ } if (p_ptr->current_r_idx == MON_COLOSSUS) { res_add(RES_SOUND); res_add(RES_DISEN); p_ptr->pspeed -= 3; p_ptr->to_a += 35; p_ptr->dis_to_a += 35; p_ptr->magic_resistance += 5; } if (p_ptr->current_r_idx == MON_SKY_GOLEM) { res_add(RES_COLD); res_add(RES_TIME); res_add(RES_LITE); p_ptr->to_a += 10; p_ptr->dis_to_a += 10; p_ptr->magic_resistance += 5; } if (p_ptr->current_r_idx == MON_SPELLWARP_AUTOMATON) { res_add(RES_TELEPORT); p_ptr->pspeed -= 1; p_ptr->no_stun = TRUE; p_ptr->to_a += 10; p_ptr->dis_to_a += 10; p_ptr->magic_resistance += 20; /* RES_ALL ... Magic Resistance no longer applies to innate breath attacks which are not really magical */ res_add(RES_ACID); res_add(RES_LITE); res_add(RES_DARK); res_add(RES_NETHER); res_add(RES_NEXUS); res_add(RES_SOUND); res_add(RES_CHAOS); res_add(RES_DISEN); } }
static void _calc_bonuses(void) { p_ptr->regen += 100 + 2*p_ptr->lev; if (p_ptr->lev >= 30) res_add(RES_FEAR); if (p_ptr->cut > 0) { int to_h = 0; int to_d = 0; int to_stealth = 0; if (p_ptr->cut >= CUT_MORTAL_WOUND) { to_h = 25; to_d = 25; to_stealth = -10; } else if (p_ptr->cut >= CUT_DEEP_GASH) { to_h = 15; to_d = 15; to_stealth = -3; } else if (p_ptr->cut >= CUT_SEVERE) { to_h = 8; to_d = 8; to_stealth = -2; } else if (p_ptr->cut >= CUT_NASTY) { to_h = 6; to_d = 6; to_stealth = -2; } else if (p_ptr->cut >= CUT_BAD) { to_h = 4; to_d = 4; to_stealth = -1; } else if (p_ptr->cut >= CUT_LIGHT) { to_h = 2; to_d = 2; to_stealth = -1; } else { to_h = 1; to_d = 1; to_stealth = -1; } p_ptr->weapon_info[0].to_h += to_h; p_ptr->weapon_info[1].to_h += to_h; p_ptr->to_h_m += to_h; p_ptr->weapon_info[0].dis_to_h += to_h; p_ptr->weapon_info[1].dis_to_h += to_h; p_ptr->weapon_info[0].to_d += to_d; p_ptr->weapon_info[1].to_d += to_d; p_ptr->to_d_m += to_d; p_ptr->weapon_info[0].dis_to_d += to_d; p_ptr->weapon_info[1].dis_to_d += to_d; p_ptr->skills.stl += to_stealth; } if (p_ptr->tim_blood_shield) { int amt = 100 * (p_ptr->mhp - p_ptr->chp) / p_ptr->mhp; p_ptr->to_a += amt; p_ptr->dis_to_a += amt; if (amt > 60) p_ptr->reflect = TRUE; } if (p_ptr->tim_blood_feast) { p_ptr->weapon_info[0].to_d += 35; p_ptr->weapon_info[1].to_d += 35; p_ptr->to_d_m += 35; /* Tentacles, beak, etc. */ p_ptr->weapon_info[0].dis_to_d += 35; p_ptr->weapon_info[1].dis_to_d += 35; } }
static void _half_giant_calc_bonuses(void) { p_ptr->sustain_str = TRUE; res_add(RES_SHARDS); }
static void _calc_bonuses(void) { if (p_ptr->lev >= 40) res_add(RES_FEAR); }
static void _calc_bonuses(void) { int i; int l = p_ptr->lev; int to_a = l + l*l/50 + l*l*l/2500; to_a += _calc_amount(_essences[_ESSENCE_AC], 2, 10); if (p_ptr->current_r_idx == MON_DEATH_SCYTHE) to_a -= 50; p_ptr->to_a += to_a; p_ptr->dis_to_a += to_a; p_ptr->pspeed += 1; p_ptr->levitation = TRUE; p_ptr->no_cut = TRUE; res_add(RES_BLIND); res_add(RES_POIS); p_ptr->hold_life = TRUE; if (p_ptr->lev >= 10) p_ptr->pspeed += 1; if (p_ptr->lev >= 25) p_ptr->pspeed += 1; if (p_ptr->lev >= 35) p_ptr->pspeed += 2; if (p_ptr->lev >= 45) { p_ptr->pspeed += 2; p_ptr->sh_retaliation = TRUE; } for (i = 0; i < 6; i++) /* Assume in order */ p_ptr->stat_add[A_STR + i] += _calc_stat_bonus(TR_STR + i); for (i = 0; i < RES_MAX; i++) { int j = res_get_object_flag(i); int n = _calc_amount(_essences[j], _res_power(i), 1); for (; n; --n) res_add(i); } if (_essences[TR_IM_ACID] >= 3) res_add_immune(RES_ACID); if (_essences[TR_IM_ELEC] >= 3) res_add_immune(RES_ELEC); if (_essences[TR_IM_FIRE] >= 3) res_add_immune(RES_FIRE); if (_essences[TR_IM_COLD] >= 3) res_add_immune(RES_COLD); p_ptr->life += 3*_calc_amount(_essences[TR_LIFE], 7, 1); p_ptr->skills.stl += _calc_amount(_essences[TR_STEALTH], 2, 1); p_ptr->pspeed += _calc_amount(_essences[TR_SPEED], 1, 10); p_ptr->skills.dev += 8*_calc_amount(_essences[TR_MAGIC_MASTERY], 2, 1); p_ptr->device_power += _calc_amount(_essences[TR_DEVICE_POWER], 2, 1); p_ptr->skills.srh += 5*_calc_amount(_essences[TR_SEARCH], 2, 1); p_ptr->skills.fos += 5*_calc_amount(_essences[TR_SEARCH], 2, 1); p_ptr->see_infra += _calc_amount(_essences[TR_INFRA], 2, 1); p_ptr->skill_dig += 20*_calc_amount(_essences[TR_TUNNEL], 2, 1); if (_essences[TR_SUST_STR] >= 5) p_ptr->sustain_str = TRUE; if (_essences[TR_SUST_INT] >= 5) p_ptr->sustain_int = TRUE; if (_essences[TR_SUST_WIS] >= 5) p_ptr->sustain_wis = TRUE; if (_essences[TR_SUST_DEX] >= 5) p_ptr->sustain_dex = TRUE; if (_essences[TR_SUST_CON] >= 5) p_ptr->sustain_con = TRUE; if (_essences[TR_SUST_CHR] >= 5) p_ptr->sustain_chr = TRUE; if (_essences[TR_TELEPATHY] >= 2) p_ptr->telepathy = TRUE; if (_essences[TR_ESP_ANIMAL] >= 2) p_ptr->esp_animal = TRUE; if (_essences[TR_ESP_UNDEAD] >= 2) p_ptr->esp_undead = TRUE; if (_essences[TR_ESP_DEMON] >= 2) p_ptr->esp_demon = TRUE; if (_essences[TR_ESP_ORC] >= 2) p_ptr->esp_orc = TRUE; if (_essences[TR_ESP_TROLL] >= 2) p_ptr->esp_troll = TRUE; if (_essences[TR_ESP_GIANT] >= 2) p_ptr->esp_giant = TRUE; if (_essences[TR_ESP_DRAGON] >= 2) p_ptr->esp_dragon = TRUE; if (_essences[TR_ESP_HUMAN] >= 2) p_ptr->esp_human = TRUE; if (_essences[TR_ESP_EVIL] >= 2) p_ptr->esp_evil = TRUE; if (_essences[TR_ESP_GOOD] >= 2) p_ptr->esp_good = TRUE; if (_essences[TR_ESP_NONLIVING] >= 2) p_ptr->esp_nonliving = TRUE; if (_essences[TR_ESP_UNIQUE] >= 2) p_ptr->esp_unique = TRUE; if (_essences[TR_NO_MAGIC] >= 5) p_ptr->anti_magic = TRUE; if (_essences[TR_FREE_ACT] >= 2) p_ptr->free_act = TRUE; if (_essences[TR_SEE_INVIS] >= 3) p_ptr->see_inv = TRUE; if (_essences[TR_SLOW_DIGEST] >= 2) p_ptr->slow_digest = TRUE; if (_essences[TR_REGEN] >= 7) p_ptr->regenerate = TRUE; if (_essences[TR_REFLECT] >= 3) p_ptr->reflect = TRUE; if (_essences[TR_SH_FIRE] >= 7) p_ptr->sh_fire = TRUE; if (_essences[TR_SH_ELEC] >= 7) p_ptr->sh_elec = TRUE; if (_essences[TR_SH_COLD] >= 7) p_ptr->sh_cold = TRUE; }
static void _giant_spider_calc_bonuses(void) { res_add(RES_POIS); p_ptr->see_nocto = TRUE; }
static void _dwarf_calc_bonuses(void) { res_add(RES_BLIND); }
static void _half_titan_calc_bonuses(void) { res_add(RES_CHAOS); }
static void _khorne_calc_bonuses(void) { p_ptr->align -= 200; res_add(RES_FIRE); res_add(RES_NETHER); p_ptr->slow_digest = TRUE; p_ptr->hold_life = TRUE; p_ptr->no_eldritch = TRUE; switch (p_ptr->current_r_idx) { case MON_BLOODLETTER_KHORNE: p_ptr->regen += 100; res_add(RES_COLD); res_add(RES_POIS); res_add(RES_CHAOS); break; case MON_FLESHHOUND_KHORNE: p_ptr->pspeed += 2; res_add(RES_CONF); res_add(RES_NEXUS); res_add(RES_DISEN); break; case MON_JUGGERNAUT_KHORNE: p_ptr->pspeed += 4; p_ptr->to_a += 100; p_ptr->dis_to_a += 100; p_ptr->reflect = TRUE; p_ptr->free_act = TRUE; p_ptr->see_inv = TRUE; res_add(RES_COLD); res_add(RES_ELEC); res_add(RES_POIS); res_add(RES_CONF); res_add(RES_FEAR); break; case MON_BLOODTHIRSTER: p_ptr->pspeed += 6; p_ptr->to_a += 50; p_ptr->dis_to_a += 50; p_ptr->regen += 150; p_ptr->levitation = TRUE; p_ptr->free_act = TRUE; p_ptr->see_inv = TRUE; res_add(RES_ACID); res_add(RES_COLD); res_add(RES_POIS); res_add(RES_CONF); res_add(RES_NEXUS); res_add(RES_TELEPORT); break; } }
/**************************************************************** * High-Elf ****************************************************************/ static void _high_elf_calc_bonuses(void) { res_add(RES_LITE); p_ptr->see_inv = TRUE; }
static void _calc_bonuses(void) { int l = p_ptr->lev; int to_a = l/10 + l*l/250 + l*l*l/12500; int tier = _find_tier(p_ptr->current_r_idx); p_ptr->skill_dig += 100; p_ptr->to_a += to_a; p_ptr->dis_to_a += to_a; if (tier > 3) p_ptr->pspeed += (tier - 3); switch (p_ptr->current_r_idx) { /* Tier 1 */ case MON_LIGHT_HOUND: res_add(RES_LITE); break; case MON_SHADOW_HOUND: res_add(RES_DARK); res_add_vuln(RES_LITE); break; /* Tier 2 */ case MON_FIRE_HOUND: res_add(RES_FIRE); res_add(RES_FIRE); res_add_vuln(RES_COLD); break; case MON_COLD_HOUND: res_add(RES_COLD); res_add(RES_COLD); res_add_vuln(RES_FIRE); break; case MON_ENERGY_HOUND: res_add(RES_ELEC); res_add(RES_ELEC); break; case MON_AIR_HOUND: res_add(RES_POIS); res_add(RES_POIS); break; case MON_WATER_HOUND: res_add(RES_ACID); res_add(RES_ACID); break; /* Tier 3 */ case MON_EARTH_HOUND: res_add(RES_SHARDS); break; case MON_VIBRATION_HOUND: res_add(RES_SOUND); res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_NEXUS_HOUND: res_add(RES_NEXUS); res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_MULTI_HUED_HOUND: p_ptr->pspeed += 3; res_add(RES_FIRE); res_add(RES_COLD); res_add(RES_ACID); res_add(RES_ELEC); res_add(RES_POIS); res_add(RES_CONF); p_ptr->free_act = TRUE; break; /* Tier 4 */ case MON_INERTIA_HOUND: res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_IMPACT_HOUND: res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_NETHER_HOUND: p_ptr->pspeed += 5; res_add(RES_NETHER); res_add(RES_CONF); p_ptr->free_act = TRUE; break; /* Tier 5 */ case MON_GRAVITY_HOUND: res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_TIME_HOUND: p_ptr->pspeed += 7; res_add(RES_TIME); res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_PLASMA_HOUND: p_ptr->pspeed += 5; res_add(RES_ELEC); res_add(RES_FIRE); res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_CHAOS_HOUND: p_ptr->pspeed += 5; res_add(RES_CHAOS); res_add(RES_CONF); p_ptr->free_act = TRUE; break; /* Tier 6 */ case MON_HOUND_OF_TINDALOS: p_ptr->pspeed += 7; res_add(RES_NETHER); res_add(RES_TIME); res_add(RES_CONF); p_ptr->free_act = TRUE; p_ptr->levitation = TRUE; p_ptr->pass_wall = TRUE; p_ptr->no_passwall_dam = TRUE; break; case MON_MANA_HOUND: p_ptr->pspeed += 10; res_add(RES_CONF); p_ptr->free_act = TRUE; break; case MON_AETHER_HOUND: p_ptr->pspeed += 5; res_add(RES_FIRE); res_add(RES_COLD); res_add(RES_ACID); res_add(RES_ELEC); res_add(RES_POIS); res_add(RES_LITE); res_add(RES_DARK); res_add(RES_CONF); res_add(RES_NETHER); res_add(RES_NEXUS); res_add(RES_SOUND); res_add(RES_SHARDS); res_add(RES_CHAOS); res_add(RES_DISEN); res_add(RES_TIME); p_ptr->sh_cold = TRUE; p_ptr->sh_fire = TRUE; p_ptr->sh_elec = TRUE; p_ptr->free_act = TRUE; break; } }
static void _imp_calc_bonuses(void) { res_add(RES_FIRE); if (p_ptr->lev >= 10) p_ptr->see_inv = TRUE; }
static void _calc_bonuses(void) { int l = p_ptr->lev; int ac = l/2 + l*l/100; p_ptr->to_a += ac; p_ptr->dis_to_a += ac; p_ptr->levitation = TRUE; if (p_ptr->lev >= 45) { p_ptr->telepathy = TRUE; res_add(RES_TELEPORT); res_add(RES_POIS); res_add(RES_CONF); p_ptr->free_act = TRUE; p_ptr->pspeed += 6; } else if (p_ptr->lev >= 35) { p_ptr->telepathy = TRUE; res_add(RES_TELEPORT); res_add(RES_ACID); res_add(RES_FIRE); res_add(RES_COLD); res_add(RES_ELEC); res_add(RES_POIS); res_add(RES_NETHER); res_add(RES_CONF); p_ptr->free_act = TRUE; p_ptr->pspeed += 4; p_ptr->hold_life = TRUE; } else if (p_ptr->lev >= 25) { res_add(RES_TELEPORT); res_add(RES_POIS); res_add(RES_CONF); p_ptr->free_act = TRUE; p_ptr->pspeed += 2; } else if (p_ptr->lev >= 10) { res_add(RES_FEAR); res_add(RES_CONF); p_ptr->free_act = TRUE; } else { res_add(RES_POIS); } }
static void _barbarian_calc_bonuses(void) { res_add(RES_FEAR); }
/**************************************************************** * Hades ****************************************************************/ static void _hades_calc_bonuses(void) { res_add(RES_NETHER); p_ptr->hold_life = TRUE; p_ptr->sustain_con = TRUE; }
static void _beastman_calc_bonuses(void) { res_add(RES_CONF); res_add(RES_SOUND); }
/**************************************************************** * Zeus ****************************************************************/ static void _zeus_calc_bonuses(void) { res_add(RES_ELEC); p_ptr->sh_elec = TRUE; }
void res_add_all(void) { int i; for (i = 0; i < RES_MAX; i++) res_add(i); }