1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
/*
* Copyright (C) 2000-2001 The Exult Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef CHEAT_H
#define CHEAT_H
#include "vec.h"
class Game_window;
class ShapeBrowser;
class SoundTester;
class CheatScreen;
class Actor;
class Game_object;
class Tile_coord;
class Effects_manager;
class Cheat
{
public:
Cheat();
~Cheat();
void init (void);
void finish_init (void);
enum Map_editor_mode {
move = 0, // Normal dragging.
paint = 1, // Left-mouse dragging paints shapes.
paint_chunks = 2, // Left-dragging paints whole chunks.
combo_pick = 3 // Left-click adds item to combo.
};
private:
Game_window *gwin;
Effects_manager *eman;
ShapeBrowser *browser;
SoundTester *tester;
CheatScreen *cscreen;
bool god_mode;
bool wizard_mode;
bool map_editor;
bool tile_grid;
Map_editor_mode edit_mode;
int edit_lift;
int edit_shape, edit_frame; // What to 'paint' with.
int edit_chunknum; // For painting with chunks.
Game_object_vector selected; // Selected objects (map-editing).
Game_object_vector clipboard; // Cut/copy/paste objects.
bool infravision;
bool pickpocket;
bool grab_actor;
bool npc_numbers;
bool hack_mover;
bool enabled;
void send_select_status();
public:
bool operator() (void) const { return enabled; }
void set_enabled(bool en);
bool in_god_mode (void) const { return god_mode; }
bool in_wizard_mode (void) const { return wizard_mode; }
bool in_map_editor(void) const { return map_editor; }
bool show_tile_grid(void) const { return map_editor && tile_grid; }
Map_editor_mode get_edit_mode(void) const { return edit_mode; }
int get_edit_lift(void) const { return edit_lift; }
int get_edit_shape(void) const { return edit_shape; }
int get_edit_frame(void) const { return edit_frame; }
int get_edit_chunknum(void) const { return edit_chunknum; }
bool in_infravision (void) const { return infravision; }
bool in_pickpocket (void) const {return pickpocket; }
bool in_hack_mover (void) const { return (hack_mover || map_editor); }
void toggle_god (void);
void set_god (bool god) { god_mode = god; }
void toggle_wizard (void);
void set_wizard (bool wizard) { wizard_mode = wizard; }
void toggle_map_editor (void);
void toggle_tile_grid (void);
void set_edit_mode(Map_editor_mode md) { edit_mode = md; }
void set_edit_lift(int lift);
void set_edit_shape(int sh, int fr);
void set_edit_chunknum(int chnum) { edit_chunknum = chnum; }
void set_map_editor (bool map) { map_editor = map; }
void toggle_infravision (void);
void set_infravision (bool infra) { infravision = infra; }
void toggle_pickpocket (void);
void set_pickpocket (bool pick) { pickpocket = pick; }
void toggle_hack_mover (void);
void set_hack_mover (bool hm) { hack_mover = hm; }
void toggle_eggs (void) const;
void change_gender (void) const;
void toggle_Petra (void) const;
void toggle_naked (void) const;
void change_skin (void) const;
void levelup_party (void) const;
void heal_party (void) const;
void fake_time_period (void) const;
void dec_skip_lift (void) const;
void set_skip_lift (int skip) const;
void append_selected(Game_object *obj);
void toggle_selected(Game_object *obj);
void clear_selected();
void delete_selected();
void move_selected(int dx, int dy, int dz);
const Game_object_vector& get_selected() const
{ return selected; }
bool is_selected(Game_object *o)
{ return selected.size() ? (selected.find(o) != -1) : false; }
void cut(bool copy = false);
void paste(int mx, int my);
void paste();
const Game_object_vector& get_clipboard() const
{ return clipboard; }
void map_teleport (void) const;
void cursor_teleport (void) const;
void create_coins (void) const;
void create_last_shape (void) const;
void delete_object (void);
void shape_browser (void) const;
bool get_browser_shape (int &shape, int &frame) const;
void sound_tester (void) const;
void cheat_screen (void) const;
bool grabbing_actor (void) const { return grab_actor; }
void toggle_grab_actor(void);
void set_grab_actor(bool grab) { grab_actor = grab; }
void set_grabbed_actor (Actor *actor) const;
void clear_this_grabbed_actor (Actor *actor) const;
bool number_npcs (void) const { return npc_numbers; }
void toggle_number_npcs(void);
void set_number_npcs(bool num) { npc_numbers = num; }
};
extern Cheat cheat;
#endif
|