cheat.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2000-2001  The Exult Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef CHEAT_H
00020 #define CHEAT_H
00021 
00022 #include "vec.h"
00023 
00024 class Game_window;
00025 class ShapeBrowser;
00026 class SoundTester;
00027 class CheatScreen;
00028 class Actor;
00029 class Game_object;
00030 class Tile_coord;
00031 class Effects_manager;
00032 
00033 class Cheat
00034 {
00035  public:
00036   Cheat();
00037   ~Cheat();
00038 
00039   void init (void);
00040   void finish_init (void);
00041   enum Map_editor_mode {
00042   move = 0,     // Normal dragging.
00043   paint = 1,      // Left-mouse dragging paints shapes.
00044   paint_chunks = 2,   // Left-dragging paints whole chunks.
00045   combo_pick = 3      // Left-click adds item to combo.
00046   };
00047 private:
00048   Game_window *gwin;
00049   Effects_manager *eman;
00050   ShapeBrowser *browser;
00051   SoundTester *tester;
00052   CheatScreen *cscreen;
00053 
00054   bool god_mode;
00055   bool wizard_mode;
00056   bool map_editor;
00057   bool tile_grid;
00058   Map_editor_mode edit_mode;
00059   int  edit_lift;
00060   int  edit_shape, edit_frame;    // What to 'paint' with.
00061   int  edit_chunknum;     // For painting with chunks.
00062   Game_object_vector selected;    // Selected objects (map-editing).
00063   Game_object_vector clipboard;   // Cut/copy/paste objects.
00064   bool infravision;
00065   bool pickpocket;
00066   bool grab_actor;
00067   bool npc_numbers;
00068   bool hack_mover;
00069 
00070   bool enabled;
00071 
00072   void send_select_status();
00073 public:
00074   bool operator() (void) const { return enabled; }
00075   void set_enabled(bool en);
00076 
00077   bool in_god_mode (void) const { return god_mode; }
00078   bool in_wizard_mode (void) const { return wizard_mode; }
00079   bool in_map_editor(void) const { return map_editor; }
00080   bool show_tile_grid(void) const { return map_editor && tile_grid; }
00081   Map_editor_mode get_edit_mode(void) const { return edit_mode; }
00082   int  get_edit_lift(void) const { return edit_lift; }
00083   int  get_edit_shape(void) const { return edit_shape; }
00084   int  get_edit_frame(void) const { return edit_frame; }
00085   int  get_edit_chunknum(void) const { return edit_chunknum; }
00086   bool in_infravision (void) const { return infravision; }
00087   bool in_pickpocket (void) const {return pickpocket; }
00088   bool in_hack_mover (void) const { return (hack_mover || map_editor); }
00089   
00090   void toggle_god (void);
00091   void set_god (bool god) { god_mode = god; }
00092   void toggle_wizard (void);
00093   void set_wizard (bool wizard) { wizard_mode = wizard; }
00094   void toggle_map_editor (void);
00095   void toggle_tile_grid (void);
00096   void set_edit_mode(Map_editor_mode md) { edit_mode = md; }
00097   void set_edit_lift(int lift);
00098   void set_edit_shape(int sh, int fr);
00099   void set_edit_chunknum(int chnum) { edit_chunknum = chnum; }
00100   void set_map_editor (bool map) { map_editor = map; }
00101   void toggle_infravision (void);
00102   void set_infravision (bool infra) { infravision = infra; }
00103   void toggle_pickpocket (void);
00104   void set_pickpocket (bool pick) { pickpocket = pick; }
00105   void toggle_hack_mover (void);
00106   void set_hack_mover (bool hm) { hack_mover = hm; }
00107 
00108   void toggle_eggs (void) const;
00109   void change_gender (void) const;
00110 
00111   void toggle_Petra (void) const;
00112   void toggle_naked (void) const;
00113   void change_skin (void) const;
00114 
00115   void levelup_party (void) const;
00116   void heal_party (void) const;
00117 
00118   void fake_time_period (void) const;
00119   void dec_skip_lift (void) const;
00120   void set_skip_lift (int skip) const;
00121 
00122   void append_selected(Game_object *obj);
00123   void toggle_selected(Game_object *obj);
00124   void clear_selected();
00125   void delete_selected();
00126   void move_selected(int dx, int dy, int dz);
00127   const Game_object_vector& get_selected() const
00128   { return selected; }
00129   bool is_selected(Game_object *o)
00130   { return selected.size() ? (selected.find(o) != -1) : false; }
00131 
00132   void cut(bool copy = false);
00133   void paste(int mx, int my);
00134   void paste();
00135   const Game_object_vector& get_clipboard() const
00136   { return clipboard; }
00137 
00138   void map_teleport (void) const;
00139   void cursor_teleport (void) const;
00140 
00141   void create_coins (void) const;
00142   void create_last_shape (void) const;
00143   void delete_object (void);
00144   void shape_browser (void) const;
00145   bool get_browser_shape (int &shape, int &frame) const;
00146   void sound_tester (void) const;
00147 
00148   void cheat_screen (void) const;
00149 
00150   bool grabbing_actor (void) const { return grab_actor; }
00151   void toggle_grab_actor(void);
00152   void set_grab_actor(bool grab) { grab_actor = grab; }
00153   void set_grabbed_actor (Actor *actor) const;
00154   void clear_this_grabbed_actor (Actor *actor) const;
00155 
00156   bool number_npcs (void) const { return npc_numbers; }
00157   void toggle_number_npcs(void);
00158   void set_number_npcs(bool num) { npc_numbers = num; }
00159 };
00160 
00161 extern Cheat cheat;
00162 
00163 #endif

Generated on Mon Jul 9 14:42:44 2007 for ExultEngine by  doxygen 1.5.1