src/skills.c File Reference

#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 Documentation

#define _skills_c

This file contains all the functions managing the character skills, which means all the special functions and also the spells of the players character.

Definition at line 31 of file skills.c.

#define AC_X   260

Definition at line 58 of file skills.c.

#define AC_Y   171

Definition at line 59 of file skills.c.

#define BUTTON_HEIGHT   19

Definition at line 50 of file skills.c.

#define BUTTON_MOD_X   (-6)

Definition at line 47 of file skills.c.

#define BUTTON_MOD_Y   (-4)

Definition at line 48 of file skills.c.

#define BUTTON_WIDTH   35

Definition at line 49 of file skills.c.

#define CHA_BUTTON_X   600

Definition at line 63 of file skills.c.

#define CHA_BUTTON_Y   430

Definition at line 64 of file skills.c.

#define CLASS_X   175

Definition at line 40 of file skills.c.

#define DAMAGE_X   260

Definition at line 52 of file skills.c.

#define DAMAGE_Y   225

Definition at line 53 of file skills.c.

#define EXPERIENCE_Y   150

Definition at line 42 of file skills.c.

#define FIRST_SKILLRECT_Y   16

Referenced by ShowSkillsScreen().

#define GOLD_Y   132

Definition at line 45 of file skills.c.

#define INTER_SKILLRECT_DIST   17

Referenced by ShowSkillsScreen().

#define INV_BUTTON_HEIGHT   22

Definition at line 66 of file skills.c.

#define INV_BUTTON_WIDTH   38

Definition at line 65 of file skills.c.

#define INV_BUTTON_X   600

Definition at line 61 of file skills.c.

#define INV_BUTTON_Y   400

Definition at line 62 of file skills.c.

#define NEXT_LEVEL_Y   220

Definition at line 43 of file skills.c.

#define RECHARGE_X   260

Definition at line 55 of file skills.c.

#define RECHARGE_Y   200

Definition at line 56 of file skills.c.

#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().


Function Documentation

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]

Definition at line 108 of file skills.c.

References Me, and SpellSkillMap.

Referenced by DoSkill().

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 
)

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  ) 

void HandleCurrentlyActivatedSkill ( void   ) 

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   ) 

void ShowSkillsScreen ( void   ) 

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().


Variable Documentation

Definition at line 72 of file skills.c.

Referenced by HandleCurrentlyActivatedSkill().


Generated on Mon Apr 28 21:58:00 2008 for FreedroidRPG by  doxygen 1.5.5