summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:59 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:59 +0100
commit5ef53fee463b7f93b8b890ed8e6ff0db778bd596 (patch)
tree9edeb65b885f9c2108239725009c214b2d227c0f
parent63fae54381d0898503c5dc7f4dcfabc125c04807 (diff)
Move xtra2.cc functions to separate header
Remove some functions and make others static while we're at it.
-rw-r--r--src/birth.cc5
-rw-r--r--src/bldg.cc1
-rw-r--r--src/cmd1.cc1
-rw-r--r--src/cmd2.cc1
-rw-r--r--src/cmd3.cc1
-rw-r--r--src/cmd5.cc3
-rw-r--r--src/cmd6.cc1
-rw-r--r--src/cmd7.cc1
-rw-r--r--src/corrupt.cc4
-rw-r--r--src/dungeon.cc1
-rw-r--r--src/externs.h100
-rw-r--r--src/gods.cc1
-rw-r--r--src/loadsave.cc1
-rw-r--r--src/melee1.cc5
-rw-r--r--src/melee2.cc1
-rw-r--r--src/monster2.cc6
-rw-r--r--src/monster3.cc1
-rw-r--r--src/powers.cc1
-rw-r--r--src/skills.cc5
-rw-r--r--src/spells1.cc1
-rw-r--r--src/spells2.cc1
-rw-r--r--src/spells3.cc1
-rw-r--r--src/traps.cc1
-rw-r--r--src/wizard2.cc1
-rw-r--r--src/xtra1.cc1
-rw-r--r--src/xtra2.cc11
-rw-r--r--src/xtra2.hpp95
27 files changed, 126 insertions, 126 deletions
diff --git a/src/birth.cc b/src/birth.cc
index 6336e214..21f1f5bf 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -1,7 +1,3 @@
-/* File: birth.c */
-
-/* Purpose: create a player character */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -23,6 +19,7 @@
#include "spells3.hpp"
#include "store.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <string>
diff --git a/src/bldg.cc b/src/bldg.cc
index 737002f3..0cfdd605 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -21,6 +21,7 @@
#include "q_bounty.h"
#include "store.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
/* hack as in leave_store in store.c */
static bool_ leave_bldg = FALSE;
diff --git a/src/cmd1.cc b/src/cmd1.cc
index cc57f47d..46effe49 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -14,6 +14,7 @@
#include "skills.hpp"
#include "spells3.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#define MAX_VAMPIRIC_DRAIN 100
diff --git a/src/cmd2.cc b/src/cmd2.cc
index 9c3a014a..ea68a9a3 100644
--- a/src/cmd2.cc
+++ b/src/cmd2.cc
@@ -12,6 +12,7 @@
#include "skills.hpp"
#include "spells3.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <chrono>
#include <thread>
diff --git a/src/cmd3.cc b/src/cmd3.cc
index d6b86bec..2d1a6f38 100644
--- a/src/cmd3.cc
+++ b/src/cmd3.cc
@@ -18,6 +18,7 @@
#include "squeltch.hpp"
#include "store.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <cassert>
#include <algorithm>
diff --git a/src/cmd5.cc b/src/cmd5.cc
index 88939a67..aaedc465 100644
--- a/src/cmd5.cc
+++ b/src/cmd5.cc
@@ -13,6 +13,7 @@
#include "spells5.hpp"
#include "quark.h"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <cassert>
@@ -135,7 +136,7 @@ void do_cmd_browse(void)
do_cmd_browse_aux(o_ptr);
}
-void do_poly_wounds(void)
+static void do_poly_wounds()
{
/* Changed to always provide at least _some_ healing */
s16b wounds = p_ptr->cut;
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 496bc2c8..5205a0f7 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -17,6 +17,7 @@
#include "spells5.hpp"
#include "store.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <cassert>
diff --git a/src/cmd7.cc b/src/cmd7.cc
index 519716d0..86cef678 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -17,6 +17,7 @@
#include "quark.h"
#include "skills.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
/*
* Describe class powers of Mindcrafters
diff --git a/src/corrupt.cc b/src/corrupt.cc
index a1b4af18..f273cdde 100644
--- a/src/corrupt.cc
+++ b/src/corrupt.cc
@@ -1,5 +1,7 @@
#include "angband.h"
-#include <assert.h>
+#include "xtra2.hpp"
+
+#include <cassert>
/**
* Corruptions
diff --git a/src/dungeon.cc b/src/dungeon.cc
index e8465d21..7f245d4d 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -24,6 +24,7 @@
#include "squeltch.hpp"
#include "store.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <cassert>
diff --git a/src/externs.h b/src/externs.h
index 47abbf04..50f8f17d 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -1366,106 +1366,6 @@ extern int get_keymap_mode();
/* main.c */
extern bool_ private_check_user_directory(cptr dirpath);
-/* xtra2.c */
-extern void do_rebirth(void);
-extern void set_subrace_title(player_race_mod *rmp_ptr, cptr name);
-extern void set_subrace_description(player_race_mod *rmp_ptr, cptr desc);
-extern void switch_subrace(int racem, bool_ copy_old);
-extern void drop_from_wild(void);
-extern void clean_wish_name(char *buf, char *name);
-extern bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge, const char *what);
-extern bool_ set_roots(int v, s16b ac, s16b dam);
-extern bool_ set_project(int v, s16b gf, s16b dam, s16b rad, s16b flag);
-extern bool_ set_parasite(int v, int r);
-extern bool_ set_disrupt_shield(int v);
-extern bool_ set_prob_travel(int v);
-extern bool_ set_absorb_soul(int v);
-extern bool_ set_tim_breath(int v, bool_ magical);
-extern bool_ set_tim_precognition(int v);
-extern bool_ set_tim_deadly(int v);
-extern bool_ set_tim_reflect(int v);
-extern bool_ set_tim_thunder(int v, int p1, int p2);
-extern bool_ set_strike(int v);
-extern bool_ set_tim_regen(int v, int p);
-extern bool_ set_tim_ffall(int v);
-extern bool_ set_tim_fly(int v);
-extern bool_ set_poison(int v);
-extern bool_ set_holy(int v);
-extern void set_grace(s32b v);
-extern bool_ set_mimic(int v, int p, int level);
-extern bool_ set_no_breeders(int v);
-extern bool_ set_invis(int v,int p);
-extern bool_ set_lite(int v);
-extern bool_ set_blind(int v);
-extern bool_ set_confused(int v);
-extern bool_ set_poisoned(int v);
-extern bool_ set_afraid(int v);
-extern bool_ set_paralyzed(int v);
-extern void dec_paralyzed();
-extern bool_ set_image(int v);
-extern bool_ set_fast(int v, int p);
-extern bool_ set_light_speed(int v);
-extern bool_ set_slow(int v);
-extern bool_ set_shield(int v, int p, s16b o, s16b d1, s16b d2);
-extern bool_ set_blessed(int v);
-extern bool_ set_hero(int v);
-extern bool_ set_shero(int v);
-extern bool_ set_protevil(int v);
-extern bool_ set_protgood(int v);
-extern bool_ set_protundead(int v);
-extern bool_ set_invuln(int v);
-extern bool_ set_tim_invis(int v);
-extern bool_ set_tim_infra(int v);
-extern bool_ set_mental_barrier(int v);
-extern bool_ set_oppose_acid(int v);
-extern bool_ set_oppose_elec(int v);
-extern bool_ set_oppose_fire(int v);
-extern bool_ set_oppose_cold(int v);
-extern bool_ set_oppose_pois(int v);
-extern bool_ set_oppose_ld(int v);
-extern bool_ set_oppose_cc(int v);
-extern bool_ set_oppose_ss(int v);
-extern bool_ set_oppose_nex(int v);
-extern bool_ set_stun(int v);
-extern bool_ set_cut(int v);
-extern bool_ set_food(int v);
-extern void check_experience(void);
-extern void check_experience_obj(object_type *o_ptr);
-extern void gain_exp(s32b amount);
-extern void lose_exp(s32b amount);
-extern int get_coin_type(monster_race *r_ptr);
-extern void monster_death(int m_idx);
-extern bool_ mon_take_hit(int m_idx, int dam, bool_ *fear, cptr note);
-extern bool_ change_panel(int dy, int dx);
-extern void verify_panel(void);
-extern void resize_map(void);
-extern void resize_window(void);
-extern cptr look_mon_desc(int m_idx);
-extern bool_ target_able(int m_idx);
-extern bool_ target_okay(void);
-extern bool_ target_set(int mode);
-extern bool_ get_aim_dir(int *dp);
-extern bool_ get_hack_dir(int *dp);
-extern bool_ get_rep_dir(int *dp);
-extern bool_ set_shadow(int v);
-extern bool_ set_tim_esp(int v);
-extern bool_ tgp_pt(int *x, int * y);
-extern bool_ tgt_pt (int *x, int *y);
-extern void do_poly_self(void);
-extern void do_poly_wounds(void);
-extern bool_ curse_weapon(void);
-extern bool_ curse_armor(void);
-extern void random_resistance(object_type * q_ptr, bool_ is_scroll, int specific);
-extern void great_side_effect(void);
-extern void nasty_side_effect(void);
-extern void deadly_side_effect(bool_ god);
-extern void godly_wrath_blast(void);
-extern int interpret_grace(void);
-extern int interpret_favor(void);
-extern void make_wish(void);
-extern bool_ set_sliding(s16b v);
-extern void create_between_gate(int dist, int y, int x);
-
/* levels.c */
extern bool_ get_dungeon_generator(char *buf);
extern bool_ get_level_desc(char *buf);
diff --git a/src/gods.cc b/src/gods.cc
index ea23f3fb..d810846a 100644
--- a/src/gods.cc
+++ b/src/gods.cc
@@ -9,6 +9,7 @@
#include "angband.h"
#include "skills.hpp"
+#include "xtra2.hpp"
#include <cassert>
diff --git a/src/loadsave.cc b/src/loadsave.cc
index 31782940..e7f7e8c1 100644
--- a/src/loadsave.cc
+++ b/src/loadsave.cc
@@ -9,6 +9,7 @@
#include "modules.hpp"
#include "quark.h"
#include "hooks.h"
+#include "xtra2.hpp"
#include <cassert>
#include <memory>
diff --git a/src/melee1.cc b/src/melee1.cc
index a506eb1a..4e6111b5 100644
--- a/src/melee1.cc
+++ b/src/melee1.cc
@@ -1,7 +1,3 @@
-/* File: melee1.c */
-
-/* Purpose: Monster attacks */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -15,6 +11,7 @@
#include "skills.hpp"
#include "store.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/src/melee2.cc b/src/melee2.cc
index ff3a9150..744e99fe 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -21,6 +21,7 @@
#include "messages.h"
#include "quark.h"
#include "skills.hpp"
+#include "xtra2.hpp"
#include <cassert>
diff --git a/src/monster2.cc b/src/monster2.cc
index 4c129de9..d6c75f91 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -1,7 +1,3 @@
-/* File: monster2.c */
-
-/* Purpose: misc code for monsters */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -9,12 +5,12 @@
* not for profit purposes provided that this copyright and statement are
* included in all such copies.
*/
-
#include "angband.h"
#include "hooks.h"
#include "mimic.hpp"
#include "randart.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <algorithm>
#include <string>
diff --git a/src/monster3.cc b/src/monster3.cc
index ea688619..e8ff9841 100644
--- a/src/monster3.cc
+++ b/src/monster3.cc
@@ -9,6 +9,7 @@
#include "angband.h"
#include "gods.hpp"
#include "skills.hpp"
+#include "xtra2.hpp"
/*
* Is the mon,ster in friendly state(pet, friend, ..)
diff --git a/src/powers.cc b/src/powers.cc
index 7d8280ec..e62e2f1c 100644
--- a/src/powers.cc
+++ b/src/powers.cc
@@ -14,6 +14,7 @@
#include "quark.h"
#include "hooks.h"
#include "mimic.hpp"
+#include "xtra2.hpp"
/*
* Note: return value indicates the amount of mana to use
diff --git a/src/skills.cc b/src/skills.cc
index 5df8af64..797bf131 100644
--- a/src/skills.cc
+++ b/src/skills.cc
@@ -1,7 +1,3 @@
-/* File: skills.c */
-
-/* Purpose: player skills */
-
/*
* Copyright (c) 2001 DarkGod
*
@@ -15,6 +11,7 @@
#include "gods.hpp"
#include "hooks.h"
#include "util.hpp"
+#include "xtra2.hpp"
#include <algorithm>
#include <boost/algorithm/string/predicate.hpp>
diff --git a/src/spells1.cc b/src/spells1.cc
index f0838324..7cf56ac0 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -13,6 +13,7 @@
#include "spells5.hpp"
#include "squeltch.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <chrono>
#include <thread>
diff --git a/src/spells2.cc b/src/spells2.cc
index 844fd7ec..23963ad1 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -12,6 +12,7 @@
#include "skills.hpp"
#include "spells3.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
#include <cassert>
#include <chrono>
diff --git a/src/spells3.cc b/src/spells3.cc
index fca0f516..4cd65c0f 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -8,6 +8,7 @@
#include "spell_idx_list.hpp"
#include "skills.hpp"
#include "mimic.hpp"
+#include "xtra2.hpp"
#include <vector>
diff --git a/src/traps.cc b/src/traps.cc
index 0b423ec6..d9056f83 100644
--- a/src/traps.cc
+++ b/src/traps.cc
@@ -10,6 +10,7 @@
#include "angband.h"
#include "gods.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
bool_ do_player_trap_call_out(void)
{
diff --git a/src/wizard2.cc b/src/wizard2.cc
index 1278ac8c..b98b7131 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -16,6 +16,7 @@
#include "randart.hpp"
#include "status.hpp"
#include "xtra1.hpp"
+#include "xtra2.hpp"
/*
* Adds a lvl to a monster
diff --git a/src/xtra1.cc b/src/xtra1.cc
index daf19bc0..6ab0de8b 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -16,6 +16,7 @@
#include "mimic.hpp"
#include "skills.hpp"
#include "spells3.hpp"
+#include "xtra2.hpp"
#include <cassert>
diff --git a/src/xtra2.cc b/src/xtra2.cc
index 41888186..63e2f45f 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -1,8 +1,3 @@
-/* File: xtra2.c */
-/* File: xtra2.c */
-
-/* Purpose: effects of various "objects", targetting and panel handling */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -11,6 +6,8 @@
* included in all such copies.
*/
+#include "xtra2.hpp"
+
#include "angband.h"
#include "corrupt.hpp"
#include "gods.hpp"
@@ -5356,7 +5353,7 @@ void set_grace(s32b v)
handle_stuff();
}
-bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge, const char *what)
+static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge, const char *what)
{
int i, j, jb, save_aware;
char buf[200];
@@ -5474,7 +5471,7 @@ bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge, const
return FALSE;
}
-void clean_wish_name(char *buf, char *name)
+static void clean_wish_name(char *buf, char *name)
{
char *p;
int i, j;
diff --git a/src/xtra2.hpp b/src/xtra2.hpp
new file mode 100644
index 00000000..af6c624b
--- /dev/null
+++ b/src/xtra2.hpp
@@ -0,0 +1,95 @@
+#pragma once
+
+#include "angband.h"
+
+extern void do_rebirth(void);
+extern void set_subrace_title(player_race_mod *rmp_ptr, cptr name);
+extern void set_subrace_description(player_race_mod *rmp_ptr, cptr desc);
+extern void switch_subrace(int racem, bool_ copy_old);
+extern void drop_from_wild(void);
+extern bool_ set_roots(int v, s16b ac, s16b dam);
+extern bool_ set_project(int v, s16b gf, s16b dam, s16b rad, s16b flag);
+extern bool_ set_parasite(int v, int r);
+extern bool_ set_disrupt_shield(int v);
+extern bool_ set_prob_travel(int v);
+extern bool_ set_absorb_soul(int v);
+extern bool_ set_tim_breath(int v, bool_ magical);
+extern bool_ set_tim_precognition(int v);
+extern bool_ set_tim_deadly(int v);
+extern bool_ set_tim_reflect(int v);
+extern bool_ set_tim_thunder(int v, int p1, int p2);
+extern bool_ set_strike(int v);
+extern bool_ set_tim_regen(int v, int p);
+extern bool_ set_tim_ffall(int v);
+extern bool_ set_tim_fly(int v);
+extern bool_ set_poison(int v);
+extern bool_ set_holy(int v);
+extern void set_grace(s32b v);
+extern bool_ set_mimic(int v, int p, int level);
+extern bool_ set_no_breeders(int v);
+extern bool_ set_invis(int v,int p);
+extern bool_ set_lite(int v);
+extern bool_ set_blind(int v);
+extern bool_ set_confused(int v);
+extern bool_ set_poisoned(int v);
+extern bool_ set_afraid(int v);
+extern bool_ set_paralyzed(int v);
+extern void dec_paralyzed();
+extern bool_ set_image(int v);
+extern bool_ set_fast(int v, int p);
+extern bool_ set_light_speed(int v);
+extern bool_ set_slow(int v);
+extern bool_ set_shield(int v, int p, s16b o, s16b d1, s16b d2);
+extern bool_ set_blessed(int v);
+extern bool_ set_hero(int v);
+extern bool_ set_shero(int v);
+extern bool_ set_protevil(int v);
+extern bool_ set_protgood(int v);
+extern bool_ set_protundead(int v);
+extern bool_ set_invuln(int v);
+extern bool_ set_tim_invis(int v);
+extern bool_ set_tim_infra(int v);
+extern bool_ set_mental_barrier(int v);
+extern bool_ set_oppose_acid(int v);
+extern bool_ set_oppose_elec(int v);
+extern bool_ set_oppose_fire(int v);
+extern bool_ set_oppose_cold(int v);
+extern bool_ set_oppose_pois(int v);
+extern bool_ set_oppose_ld(int v);
+extern bool_ set_oppose_cc(int v);
+extern bool_ set_oppose_ss(int v);
+extern bool_ set_oppose_nex(int v);
+extern bool_ set_stun(int v);
+extern bool_ set_cut(int v);
+extern bool_ set_food(int v);
+extern void check_experience(void);
+extern void check_experience_obj(object_type *o_ptr);
+extern void gain_exp(s32b amount);
+extern void lose_exp(s32b amount);
+extern int get_coin_type(monster_race *r_ptr);
+extern void monster_death(int m_idx);
+extern bool_ mon_take_hit(int m_idx, int dam, bool_ *fear, cptr note);
+extern bool_ change_panel(int dy, int dx);
+extern void verify_panel(void);
+extern cptr look_mon_desc(int m_idx);
+extern bool_ target_able(int m_idx);
+extern bool_ target_okay(void);
+extern bool_ target_set(int mode);
+extern bool_ get_aim_dir(int *dp);
+extern bool_ get_hack_dir(int *dp);
+extern bool_ get_rep_dir(int *dp);
+extern bool_ set_shadow(int v);
+extern bool_ set_tim_esp(int v);
+extern bool_ tgp_pt(int *x, int * y);
+extern bool_ tgt_pt (int *x, int *y);
+extern void do_poly_self(void);
+extern bool_ curse_weapon(void);
+extern bool_ curse_armor(void);
+extern void random_resistance(object_type * q_ptr, bool_ is_scroll, int specific);
+extern void make_wish(void);
+extern void create_between_gate(int dist, int y, int x);
+
+extern "C" {
+ extern void resize_map(void);
+ extern void resize_window(void);
+}