#include "system.h"#include "defs.h"#include "struct.h"#include "global.h"#include "proto.h"Go to the source code of this file.
Defines | |
| #define | _skills_c |
| #define | CLASS_X 175 |
| #define | EXPERIENCE_Y 150 |
| #define | NEXT_LEVEL_Y 220 |
| #define | GOLD_Y 132 |
| #define | BUTTON_MOD_X (-6) |
| #define | BUTTON_MOD_Y (-4) |
| #define | BUTTON_WIDTH 35 |
| #define | BUTTON_HEIGHT 19 |
| #define | DAMAGE_X 260 |
| #define | DAMAGE_Y 225 |
| #define | RECHARGE_X 260 |
| #define | RECHARGE_Y 200 |
| #define | AC_X 260 |
| #define | AC_Y 171 |
| #define | INV_BUTTON_X 600 |
| #define | INV_BUTTON_Y 400 |
| #define | CHA_BUTTON_X 600 |
| #define | CHA_BUTTON_Y 430 |
| #define | INV_BUTTON_WIDTH 38 |
| #define | INV_BUTTON_HEIGHT 22 |
| #define | SPELL_LEVEL_BUTTONS_X 60 |
| #define | SPELL_LEVEL_BUTTONS_Y 423 |
| #define | SPELL_LEVEL_BUTTON_WIDTH 30 |
| #define | INTER_SKILLRECT_DIST 17 |
| #define | FIRST_SKILLRECT_Y 16 |
Functions | |
| void | ImproveSkill (int *skill) |
| static int | calculate_program_heat_cost (int program_id) |
| static int | calculate_program_hit_damage (int program_id) |
| static float | calculate_program_effect_duration (int program_id) |
| int | get_program_index_with_name (const char *pname) |
| void | TeleportHome (void) |
| void | HandleCurrentlyActivatedSkill () |
| int | DoSkill (int skill_index, int SpellCost) |
| int | CursorIsOnWhichSkillButton (int x, int y) |
| int | CursorIsOnWhichSpellPageButton (int x, int y) |
| void | ShowSkillsExplanationScreen (void) |
| void | establish_skill_subset_map (int *SkillSubsetMap) |
| void | activate_nth_aquired_skill (int skill_num) |
| void | ShowSkillsScreen (void) |
Variables | |
| int | Override_Power_Limit = 0 |
| #define _skills_c |
| #define FIRST_SKILLRECT_Y 16 |
Referenced by ShowSkillsScreen().
| #define INTER_SKILLRECT_DIST 17 |
Referenced by ShowSkillsScreen().
| #define SPELL_LEVEL_BUTTON_WIDTH 30 |
Definition at line 70 of file skills.c.
Referenced by CursorIsOnWhichSpellPageButton(), and ShowSkillsScreen().
| #define SPELL_LEVEL_BUTTONS_X 60 |
Definition at line 68 of file skills.c.
Referenced by CursorIsOnWhichSpellPageButton(), and ShowSkillsScreen().
| #define SPELL_LEVEL_BUTTONS_Y 423 |
Definition at line 69 of file skills.c.
Referenced by CursorIsOnWhichSpellPageButton(), and ShowSkillsScreen().
| void activate_nth_aquired_skill | ( | int | skill_num | ) |
Definition at line 579 of file skills.c.
References establish_skill_subset_map(), i, Me, and number_of_skills.
Referenced by ReactToSpecialKeys().
| static float calculate_program_effect_duration | ( | int | program_id | ) | [static] |
| static int calculate_program_heat_cost | ( | int | program_id | ) | [static] |
Definition at line 89 of file skills.c.
References Me, NUMBER_OF_SKILL_LEVELS, and SpellSkillMap.
Referenced by HandleCurrentlyActivatedSkill(), and ShowSkillsScreen().
| static int calculate_program_hit_damage | ( | int | program_id | ) | [static] |
Definition at line 99 of file skills.c.
References Me, MyRandom(), and SpellSkillMap.
Referenced by DoSkill().
| int CursorIsOnWhichSkillButton | ( | int | x, | |
| int | y | |||
| ) |
This function checks if a given screen position lies within the one of the skill icons and returns the number of that skill icon.
Definition at line 429 of file skills.c.
References SkillScreenRect.
Referenced by ShowSkillsScreen().
| int CursorIsOnWhichSpellPageButton | ( | int | x, | |
| int | y | |||
| ) |
This function checks if a given screen position lies within one of the spell level buttons and returns the number of that spell level button.
Definition at line 471 of file skills.c.
References i, NUMBER_OF_SKILL_PAGES, SkillScreenRect, SPELL_LEVEL_BUTTON_WIDTH, SPELL_LEVEL_BUTTONS_X, and SPELL_LEVEL_BUTTONS_Y.
Referenced by ShowSkillsScreen().
| int DoSkill | ( | int | skill_index, | |
| int | SpellCost | |||
| ) |
Definition at line 205 of file skills.c.
References AllActiveSpells, calculate_program_effect_duration(), calculate_program_hit_damage(), ChatWithFriendlyDroid(), spell_active_s::damage, bullet_s::damage, DirectLineWalkable(), Druidmap, FALSE, FillInDefaultBulletStruct(), FireTuxRangedWeaponRaw(), bullet_s::freezing_level, GameConfig, GetItemIndexByName(), GetLivingDroidBelowMouseCursor(), GetMousePos_x(), GetMousePos_y(), global_ingame_mode, GLOBAL_INGAME_MODE_IDENTIFY, hit_enemy(), i, input_axis, configuration_for_freedroid_s::Inventory_Visible, MAGENTA_BULLET, MAX_ACTIVE_SPELLS, Me, MouseCursorIsInInvRect(), MouseCursorIsInUserRect(), NULL, bullet_s::paralysation_duration, spell_active_s::paralyze_duration, PlayOnceNeededSoundSample(), bullet_s::poison_damage_per_sec, spell_active_s::poison_dmg, spell_active_s::poison_duration, bullet_s::poison_duration, PROGRAM_FORM_BULLET, PROGRAM_FORM_IMMEDIATE, PROGRAM_FORM_RADIAL, PROGRAM_FORM_SELF, RADIAL_SPELL_DIRECTIONS, silently_unhold_all_items(), SpellHitPercentageTable, SpellSkillMap, Takeover(), TeleportHome(), bullet_s::to_hit, translate_pixel_to_map_location(), TRUE, tux_wants_to_attack_now(), enemy_s::type, point_s::x, and point_s::y.
Referenced by ApplyItem(), and HandleCurrentlyActivatedSkill().
| void establish_skill_subset_map | ( | int * | SkillSubsetMap | ) |
We will draw only those skills to the skills inventory, that are already present in the Tux. That way the game remains open for new skills to the player and he doesn't now in advance which skills there are, which is more interesting than complete control and overview.
Any skills not in use will be marked as -1.
The first few entries will be filled with internal skill index numbers for reference.
Definition at line 556 of file skills.c.
References i, Me, and number_of_skills.
Referenced by activate_nth_aquired_skill(), and ShowSkillsScreen().
| int get_program_index_with_name | ( | const char * | pname | ) |
Definition at line 116 of file skills.c.
References ErrorMessage(), i, IS_FATAL, number_of_skills, PLEASE_INFORM, and SpellSkillMap.
Referenced by ApplyItem(), associate_skill_with_item(), DropEnemyTreasure(), ExecuteChatExtra(), and HandleInventoryScreen().
| void HandleCurrentlyActivatedSkill | ( | void | ) |
This function handles the skills the player might have acitivated or deactivated or whatever.
Definition at line 167 of file skills.c.
References calculate_program_heat_cost(), DoSkill(), GetInventoryItemAt(), GetInventorySquare_x(), GetInventorySquare_y(), GetMousePos_x(), GetMousePos_y(), tux_s::Inventory, ItemMap, Me, MouseCursorIsInUserRect(), MouseRightClicked(), Override_Power_Limit, PROGRAM_FORM_BULLET, PROGRAM_FORM_IMMEDIATE, PROGRAM_FORM_RADIAL, and SpellSkillMap.
Referenced by move_tux().
| void ImproveSkill | ( | int * | skill | ) |
This function improves a generic skill (hack melee ranged magic) by one
Definition at line 79 of file skills.c.
References NUMBER_OF_SKILL_LEVELS.
Referenced by ExecuteChatExtra().
| void ShowSkillsExplanationScreen | ( | void | ) |
Definition at line 503 of file skills.c.
References blit_special_background(), D_, DisplayText(), draw_gl_textured_quad_at_screen_position(), FPS_Display_BFont, LoadOneSkillSurfaceIfNotYetLoaded(), Me, NULL, our_SDL_blit_surface_wrapper(), Screen, SetCurrentFont(), SKILL_SCREEN_EXPLANATION_BACKGROUND_CODE, SpellSkillMap, TEXT_STRETCH, and use_open_gl.
Referenced by ShowSkillsScreen().
| void ShowSkillsScreen | ( | void | ) |
This function displays the SKILLS SCREEN. This is NOT the same as the CHARACTER SCREEN. In the skills screen you can see what skills/spells you currenlty have availabe and you can select a new readied skill by clicking on it with the mouse.
Definition at line 616 of file skills.c.
References _, blit_special_background(), calculate_program_heat_cost(), CHARACTERRECT_H, CHARACTERRECT_W, CHARACTERRECT_X, CursorIsOnWhichSkillButton(), CursorIsOnWhichSpellPageButton(), D_, DebugPrintf(), DisplayText(), draw_gl_textured_quad_at_screen_position(), establish_skill_subset_map(), FALSE, FIRST_SKILLRECT_Y, FontHeight(), FPS_Display_BFont, GAME_CONFIG_SCREEN_VISIBLE_SKILL_EXPLANATION, GameConfig, GetCurrentFont(), GetMousePos_x(), GetMousePos_y(), i, INTER_SKILLRECT_DIST, Load_Skill_Level_Button_Surfaces(), LoadOneSkillSurfaceIfNotYetLoaded(), Me, Message_BFont, MouseCursorIsOnButton(), MouseLeftClicked(), NULL, number_of_skills, NUMBER_OF_SKILLS_PER_SKILL_PAGE, OPEN_CLOSE_SKILL_EXPLANATION_BUTTON, our_SDL_blit_surface_wrapper(), tux_s::readied_skill, Screen, SetCurrentFont(), ShowSkillsExplanationScreen(), SKILL_SCREEN_BACKGROUND_CODE, tux_s::SkillLevel, SkillScreenRect, SPELL_LEVEL_BUTTON_WIDTH, SPELL_LEVEL_BUTTONS_X, SPELL_LEVEL_BUTTONS_Y, configuration_for_freedroid_s::spell_level_visible, SpellLevelButtonImageList, SpellSkillMap, TEXT_STRETCH, toggle_game_config_screen_visibility(), use_open_gl, point_s::x, and point_s::y.
Referenced by AssembleCombatPicture().
| void TeleportHome | ( | void | ) |
This function creates a teleporter portal to the home location.
Definition at line 138 of file skills.c.
References location_s::level, Me, ResolveMapLabelOnShip(), Teleport(), teleport_arrival_sound(), TRUE, location_s::x, and location_s::y.
Referenced by DoSkill().
| int Override_Power_Limit = 0 |
1.5.5