keyactions.cc

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2001-2004 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 #ifdef HAVE_CONFIG_H
00020 #  include <config.h>
00021 #endif
00022 
00023 #include "keyactions.h"
00024 #include "keys.h"
00025 #include "gump_utils.h"
00026 #include "gamewin.h"
00027 #include "mouse.h"
00028 #include "actors.h"
00029 #include "game.h"
00030 #include "exult.h"
00031 #include "exult_types.h"
00032 #include "exult_constants.h"
00033 #include "File_gump.h"
00034 #include "Scroll_gump.h"
00035 #include "cheat.h"
00036 #include "combat_opts.h"
00037 #include "ucmachine.h"
00038 #include "party.h"
00039 #include "Audio.h"
00040 #include "Gamemenu_gump.h"
00041 #include "Newfile_gump.h"
00042 #include "Face_stats.h"
00043 #include "Gump_manager.h"
00044 #include "effects.h"
00045 #include "palette.h"
00046 
00047 /*
00048  *  Get the i'th party member, with the 0'th being the Avatar.
00049  */
00050 
00051 static Actor *Get_party_member
00052 (
00053  int num        // 0=avatar.
00054 )
00055 {
00056   int npc_num = 0;    // Default to Avatar
00057   if (num > 0)
00058     npc_num = Game_window::get_instance()->get_party_man()->get_member(num - 1);
00059   return Game_window::get_instance()->get_npc(npc_num);
00060 }
00061 
00062 
00063 //  { ActionQuit, 0, "Quit", true, false, NONE },
00064 void ActionQuit(int *params)
00065 {
00066   Game_window::get_instance()->get_gump_man()->okay_to_quit();
00067 }
00068 
00069 // { ActionOldFileGump, 0, "Save/restore", true, false, NONE },
00070 void ActionOldFileGump(int *params)
00071 {
00072   File_gump *fileio = new File_gump();
00073   Game_window::get_instance()->get_gump_man()->do_modal_gump(fileio, 
00074                                  Mouse::hand);
00075   delete fileio;
00076 }
00077 
00078 // { ActionMenuGump, 0, "GameMenu", true, false, NONE },
00079 void ActionMenuGump(int *params)
00080 {
00081   Gamemenu_gump *gmenu = new Gamemenu_gump();
00082   Game_window::get_instance()->get_gump_man()->do_modal_gump(gmenu,
00083                                  Mouse::hand);
00084   delete gmenu;
00085 }
00086 
00087 // { ActionFileGump, 0, "Save/restore", true, false, NONE },
00088 void ActionFileGump(int *params)
00089 {
00090   Newfile_gump *fileio = new Newfile_gump();
00091   Game_window::get_instance()->get_gump_man()->do_modal_gump(fileio,
00092                                  Mouse::hand);
00093   delete fileio;
00094 }
00095 //  { ActionQuicksave, 0, "Quick-save", true, false, NONE },
00096 void ActionQuicksave(int *params)
00097 {
00098   Game_window *gwin = Game_window::get_instance();
00099   try {
00100     gwin->write();
00101   }
00102   catch(exult_exception &e) {
00103     gwin->get_effects()->center_text("Saving game failed!");
00104     return;
00105   }
00106   gwin->get_effects()->center_text("Game saved");
00107 }
00108 
00109 //  { ActionQuickrestore, 0, "Quick-restore", true, false, NONE },
00110 void ActionQuickrestore(int *params)
00111 {
00112   Game_window *gwin = Game_window::get_instance();
00113   try {
00114     gwin->read();
00115   }
00116   catch(exult_exception &e) {
00117     gwin->get_effects()->center_text("Restoring game failed!");
00118     return;
00119   }
00120   gwin->get_effects()->center_text("Game restored");
00121   gwin->paint();
00122 }
00123 
00124 //  { ActionAbout, 0, "About Exult", true, false, NONE },
00125 void ActionAbout(int *params)
00126 {
00127   Game_window *gwin = Game_window::get_instance();
00128   Scroll_gump *scroll;
00129   scroll = new Scroll_gump();
00130   
00131   scroll->add_text("Exult V"VERSION"\n");
00132   scroll->add_text("(C) 1998-2004 Exult Team\n\n");
00133   scroll->add_text("Available under the terms of the ");
00134   scroll->add_text("GNU General Public License\n\n");
00135   scroll->add_text("http://exult.sourceforge.net\n");
00136   
00137   scroll->paint();
00138   do {
00139     int x, y;
00140     Get_click(x,y, Mouse::hand);
00141   } while (scroll->show_next_page());
00142   gwin->paint();
00143   delete scroll;
00144 }
00145 
00146 //  { ActionHelp, 0, "List keys", true, false, NONE },
00147 void ActionHelp(int *params)
00148 {
00149   keybinder->ShowHelp();
00150 }
00151 
00152 //  { ActionCloseGumps, 0, "Close gumps", false, false, NONE },
00153 void ActionCloseGumps(int *params)
00154 {
00155   Game_window::get_instance()->get_gump_man()->close_all_gumps();
00156 }
00157 
00158 //  { ActionCloseOrMenu, "Game menu", true, false, NONE },
00159 void ActionCloseOrMenu(int* params)
00160 {
00161   Game_window *gwin = Game_window::get_instance();
00162   if (gwin->get_gump_man()->showing_gumps(true))
00163     gwin->get_gump_man()->close_all_gumps();
00164   else
00165     ActionMenuGump(0);
00166 }
00167 
00168 //  { ActionScreenshot, 0, "Take screenshot", true, false, NONE },
00169 void ActionScreenshot(int *params)
00170 {
00171   make_screenshot();
00172 }
00173 
00174 //  { ActionRepaint, 0, "Repaint screen", false, false, NONE },
00175 void ActionRepaint(int *params)
00176 {
00177   Game_window::get_instance()->paint();
00178 }
00179 
00180 //  { ActionResIncrease, 0, "Increase resolution", true, true, NONE },
00181 void ActionResIncrease(int *params)
00182 {
00183   increase_resolution();
00184 }
00185 
00186 //  { ActionResDecrease, 0, "Decrease resolution", true, true, NONE },
00187 void ActionResDecrease(int *params)
00188 {
00189   decrease_resolution();
00190 }
00191 
00192 //  { ActionBrighter, 0, "Increase brightness", true, false, NONE },
00193 void ActionBrighter(int *params)
00194 {
00195   change_gamma(true);
00196 }
00197 
00198 //  { ActionDarker, 0, "Decrease brightness", true, false, NONE },
00199 void ActionDarker(int *params)
00200 {
00201   change_gamma(false);
00202 }
00203 
00204 //  { ActionFullscreen, 0, "Toggle fullscreen", true, false, NONE },
00205 void ActionFullscreen(int *params)
00206 {
00207   Game_window *gwin = Game_window::get_instance();
00208   gwin->get_win()->toggle_fullscreen();
00209   gwin->paint();
00210 }
00211 
00212 //  { ActionUseItem, 3, "Use item", false, false, NONE },
00213 // params[0] = shape nr.
00214 // params[1] = frame nr.
00215 // params[2] = quality
00216 void ActionUseItem(int *params)
00217 {
00218   if (params[1] == -1) params[1] = c_any_framenum;
00219   if (params[2] == -1) params[2] = c_any_qual;
00220   Game_window::get_instance()->activate_item(params[0], params[1], params[2]);
00221 
00222   Mouse::mouse->set_speed_cursor();
00223 }
00224 
00225 //  { ActionUseItem, 3, "Use food", false, false, NONE },
00226 void ActionUseFood(int *params)
00227 {
00228   Game_window *gwin = Game_window::get_instance();
00229   if (!gwin->activate_item(377) &&  // First try normal food items.
00230       GAME_SI)      // SI has 'everlasting goblet'.
00231     gwin->activate_item(0x268, 20);
00232   Mouse::mouse->set_speed_cursor();
00233 }
00234 
00235 //  { ActionCombat, 0, "Toggle combat", true, false, NONE },
00236 void ActionCombat(int *params)
00237 {
00238   Game_window *gwin = Game_window::get_instance();
00239   gwin->toggle_combat();
00240   gwin->paint();
00241   Mouse::mouse->set_speed_cursor();
00242 }
00243 
00244 //  { ActionCombatPause, 0, "Pause combat", true, false, NONE },
00245 void ActionCombatPause(int *params)
00246 {
00247   Combat::toggle_pause();
00248   Mouse::mouse->set_speed_cursor();
00249 }
00250 
00251 //  { ActionTarget, 0, "Target mode", true, false, NONE },
00252 void ActionTarget(int *params)
00253 {
00254   int x, y;
00255   if (!Get_click(x, y, Mouse::greenselect))
00256     return;
00257   Game_window::get_instance()->double_clicked(x, y);
00258   Mouse::mouse->set_speed_cursor();
00259 }
00260 
00261 //  { ActionInventory, 1, "Show inventory", true, false, NONE },
00262 // params[0] = party member (0-7), or -1 for 'next'
00263 void ActionInventory(int *params)
00264 {
00265   Game_window *gwin = Game_window::get_instance();
00266   static int inventory_page = -1;
00267   Actor *actor;
00268   
00269   if (params[0] == -1) {
00270     Gump_manager *gump_man = gwin->get_gump_man();
00271     int party_count = gwin->get_party_man()->get_count();
00272     int shapenum;
00273     
00274     for(int i=0;i<=party_count;++i)
00275     {
00276       actor = Get_party_member(i);
00277       if (!actor)
00278         continue;
00279 
00280       shapenum = actor->inventory_shapenum();
00281       // Check if this actor's inventory page is open or not
00282       if (!gump_man->find_gump(actor, shapenum))
00283       {
00284         gump_man->add_gump(actor, shapenum); //force showing inv.
00285         inventory_page = i;
00286         return;
00287       }
00288     }
00289     inventory_page = (inventory_page+1)%(party_count+1);
00290   } else {
00291     inventory_page = params[0];
00292     if (inventory_page < 0 ||
00293         inventory_page > gwin->get_party_man()->get_count())
00294       return;
00295   }
00296   
00297   actor = Get_party_member(inventory_page);
00298   if (actor) {
00299     actor->show_inventory(); //force showing inv.
00300   }
00301 
00302   Mouse::mouse->set_speed_cursor();
00303 }
00304 
00305 //  { ActionTryKeys, 0, "Try keys", true, false, NONE },
00306 void ActionTryKeys(int *params)
00307 {
00308   Game_window *gwin = Game_window::get_instance();
00309   int x, y;     // Allow dragging.
00310   if (!Get_click(x, y, Mouse::greenselect, 0, true))
00311     return;
00312   // Look for obj. in open gump.
00313   Gump *gump = gwin->get_gump_man()->find_gump(x, y);
00314   Game_object *obj;
00315   if (gump)
00316     obj = gump->find_object(x, y);
00317   else        // Search rest of world.
00318     obj = gwin->find_object(x, y);
00319   if (!obj)
00320     return;
00321   int qual = obj->get_quality();  // Key quality should match.
00322   Actor *party[10];   // Get ->party members.
00323   int party_cnt = gwin->get_party(&party[0], 1);
00324   for (int i = 0; i < party_cnt; i++) {
00325     Actor *act = party[i];
00326     Game_object_vector keys;    // Get keys.
00327     if (act->get_objects(keys, 641, qual, c_any_framenum)) {
00328       // intercept the click_on_item call made by the key-usecode
00329       gwin->get_usecode()->intercept_click_on_item(obj);
00330       keys[0]->activate();
00331       return;
00332     }
00333   }
00334   Mouse::mouse->flash_shape(Mouse::redx); // Nothing matched.
00335 }
00336 
00337 //  { ActionStats, 1, "Show stats", true, false, NONE },
00338 // params[0] = party member (0-7), or -1 for 'next'
00339 void ActionStats(int *params)
00340 {
00341   Game_window *gwin = Game_window::get_instance();
00342   static int stats_page = -1;
00343   Actor *actor;
00344   
00345   if (params[0] == -1) {
00346     Gump_manager *gump_man = gwin->get_gump_man();
00347     int party_count = gwin->get_party_man()->get_count();
00348     int shapenum = game->get_shape("gumps/statsdisplay");
00349 
00350     for(int i=0;i<=party_count;++i)
00351     {
00352       actor = Get_party_member(i);
00353       if (!actor)
00354         continue;
00355 
00356       // Check if this actor's stats page is open or not
00357       if (!gump_man->find_gump(actor, shapenum))
00358       {
00359         gump_man->add_gump(actor, shapenum); //force showing stats.
00360         stats_page = i;
00361         return;
00362       }
00363     }
00364     stats_page = (stats_page+1)%(party_count+1);
00365   } else {
00366     stats_page = params[0];
00367     if (stats_page < 0 ||
00368       stats_page >= gwin->get_party_man()->get_count())
00369       stats_page = 0;
00370   }
00371   
00372   actor = Get_party_member(stats_page);
00373   if (actor) gwin->get_gump_man()->add_gump(actor, game->get_shape("gumps/statsdisplay"));
00374 
00375   Mouse::mouse->set_speed_cursor();
00376 }
00377 
00378 //  { ActionCombatStats, 0, "Show Combat stats", true, false, SERPENT_ISLE }
00379 void ActionCombatStats(int* params)
00380 {
00381   Game_window *gwin = Game_window::get_instance();
00382   int cnt = gwin->get_party_man()->get_count();
00383   gwin->get_gump_man()->add_gump(gwin->get_main_actor(), game->get_shape("gumps/cstats/1") + cnt);
00384 }
00385 
00386 //  { ActionFaceStats, 0, "Change Face Stats State", true, false, NONE }
00387 void ActionFaceStats(int* params)
00388 {
00389   Face_stats::AdvanceState();
00390   Face_stats::save_config(config);
00391 }
00392 
00393 
00394 //  { ActionSIIntro, 0,  "Show SI intro", true, true, SERPENT_ISLE },
00395 void ActionSIIntro(int *params)
00396 {
00397   Game_window *gwin = Game_window::get_instance();
00398   game->set_jive();
00399   game->play_intro();
00400   game->clear_jive();
00401   gwin->clear_screen(true);
00402   gwin->get_pal()->set(0);
00403   gwin->paint();
00404   gwin->get_pal()->fade(50, 1, 0);
00405 }
00406 
00407 //  { ActionEndgame, 1, "Show endgame", true, true, BLACK_GATE },
00408 // params[0] = -1,0 = won, 1 = lost
00409 void ActionEndgame(int *params)
00410 {
00411   Game_window *gwin = Game_window::get_instance();
00412   game->end_game(params[0] != 1);
00413   gwin->clear_screen(true);
00414   gwin->get_pal()->set(0);
00415   gwin->paint();
00416   gwin->get_pal()->fade(50, 1, 0);
00417 }
00418 
00419 //  { ActionScrollLeft, 0, "Scroll left", true, true, NONE },
00420 void ActionScrollLeft(int *params)
00421 {
00422   Game_window *gwin = Game_window::get_instance();
00423   for (int i = 16; i; i--)
00424     gwin->view_left();
00425 }
00426 
00427 //  { ActionScrollRight, 0, "Scroll right", true, true, NONE },
00428 void ActionScrollRight(int *params)
00429 {
00430   Game_window *gwin = Game_window::get_instance();
00431   for (int i = 16; i; i--)
00432     gwin->view_right();
00433 }
00434 
00435 //  { ActionScrollUp, 0, "Scroll up", true, true, NONE },
00436 void ActionScrollUp(int *params)
00437 {
00438   Game_window *gwin = Game_window::get_instance();
00439   for (int i = 16; i; i--)
00440     gwin->view_up();
00441 }
00442 
00443 //  { ActionScrollDown, 0, "Scroll down", true, true, NONE },
00444 void ActionScrollDown(int *params)
00445 {
00446   Game_window *gwin = Game_window::get_instance();
00447   for (int i = 16; i; i--)
00448     gwin->view_down();
00449 }
00450 
00451 //  { ActionWalkWest, 0, "Walk west", true, false, NONE },
00452 void ActionWalkWest(int *params)
00453 {
00454   Game_window *gwin = Game_window::get_instance();
00455   int speed = params[0]<0?166:50;
00456   gwin->start_actor(gwin->get_width()/2-50, gwin->get_height()/2,speed);
00457 }
00458 
00459 //  { ActionWalkEast, 0, "Walk east", true, false, NONE },
00460 void ActionWalkEast(int *params)
00461 {
00462   Game_window *gwin = Game_window::get_instance();
00463   int speed = params[0]<0?166:50;
00464   gwin->start_actor(gwin->get_width()/2+50, gwin->get_height()/2, speed);
00465 }
00466 
00467 //  { ActionWalkNorth, 0, "Walk north", true, false, NONE },
00468 void ActionWalkNorth(int *params)
00469 {
00470   Game_window *gwin = Game_window::get_instance();
00471   int speed = params[0]<0?166:50;
00472   gwin->start_actor(gwin->get_width()/2, gwin->get_height()/2-50, speed);
00473 }
00474 
00475 //  { ActionWalkSouth, 0, "Walk south", true, false, NONE },
00476 void ActionWalkSouth(int *params)
00477 {
00478   Game_window *gwin = Game_window::get_instance();
00479   int speed = params[0]<0?166:50;
00480   gwin->start_actor(gwin->get_width()/2, gwin->get_height()/2+50, speed);
00481 }
00482 
00483 //  { ActionWalkNorthEast, 0, "Walk north-east", true, false, NONE },
00484 void ActionWalkNorthEast(int *params)
00485 {
00486   Game_window *gwin = Game_window::get_instance();
00487   int speed = params[0]<0?166:50;
00488   gwin->start_actor(gwin->get_width()/2+50, gwin->get_height()/2-50, speed);
00489 }
00490 
00491 //  { ActionWalkSouthEast, 0, "Walk south-east", true, false, NONE },
00492 void ActionWalkSouthEast(int *params)
00493 {
00494   Game_window *gwin = Game_window::get_instance();
00495   int speed = params[0]<0?166:50;
00496   gwin->start_actor(gwin->get_width()/2+50, gwin->get_height()/2+50, speed);
00497 }
00498 
00499 //  { ActionWalkNorthWest, 0, "Walk north-west", true, false, NONE },
00500 void ActionWalkNorthWest(int *params)
00501 {
00502   Game_window *gwin = Game_window::get_instance();
00503   int speed = params[0]<0?166:50;
00504   gwin->start_actor(gwin->get_width()/2-50, gwin->get_height()/2-50, speed);
00505 }
00506 
00507 //  { ActionWalkSouthWest, 0, "Walk south-west", true, false, NONE },
00508 void ActionWalkSouthWest(int *params)
00509 {
00510   Game_window *gwin = Game_window::get_instance();
00511   int speed = params[0]<0?166:50;
00512   gwin->start_actor(gwin->get_width()/2-50, gwin->get_height()/2+50, speed);
00513 }
00514 
00515 //  { ActionStopWalking, 0, "Stop Walking", true, true, NONE },
00516 void ActionStopWalking(int *params)
00517 {
00518   Game_window *gwin = Game_window::get_instance();
00519   gwin->stop_actor();
00520 }
00521 
00522 //  { ActionCenter, 0, "Center screen", true, true, NONE },
00523 void ActionCenter(int *params)
00524 {
00525   Game_window *gwin = Game_window::get_instance();
00526   gwin->center_view(gwin->get_camera_actor()->get_tile());
00527   gwin->paint();
00528 }
00529 
00530 //  { ActionShapeBrowser, 0, "Shape browser", true, true, NONE },
00531 void ActionShapeBrowser(int *params)
00532 {
00533   cheat.shape_browser();
00534 }
00535 
00536 //  { ActionCreateShape, 3, "Create last shape", true, true, NONE },
00537 // params[0] = shape nr., or -1 for 'last selected shape in browser'
00538 // params[1] = frame nr.
00539 // params[2] = quantity
00540 // params[3] = quality
00541 void ActionCreateShape(int *params)
00542 {
00543   if (params[0] == -1) {
00544     cheat.create_last_shape();
00545   } else {
00546     Game_window *gwin = Game_window::get_instance();
00547     if (params[1] == -1) params[1] = 0;
00548     if (params[2] == -1) params[2] = 1;
00549     if (params[3] == -1) params[3] = c_any_qual;
00550     gwin->get_main_actor()->add_quantity(params[2], params[0], params[3], params[1]);
00551     gwin->get_effects()->center_text("Object created");
00552   }
00553 }
00554 
00555 //  { ActionDeleteObject, 0, "Delete object", true, true, NONE },
00556 void ActionDeleteObject(int *params)
00557 {
00558   cheat.delete_object();
00559 }
00560 
00561 //  { ActionDeleteSelected, "Delete selected", true, ture, NONE, false },
00562 void ActionDeleteSelected(int *params)
00563 {
00564   cheat.delete_selected();
00565 }
00566 
00567 //  { ActionMoveSelected, 3, "Move selected", true, true, NONE },
00568 // params[0] = deltax (tiles)
00569 // params[1] = deltay
00570 // params[2] = deltaz
00571 void ActionMoveSelected(int *params)
00572 {
00573   cheat.move_selected(params[0], params[1], params[2]);
00574 }
00575 
00576 //  { ActionToggleEggs, 0, "Toggle egg display", true, true, NONE },
00577 void ActionToggleEggs(int *params)
00578 {
00579   cheat.toggle_eggs();
00580 }
00581 
00582 //  { ActionGodMode, 1, "Toggle god mode", true, true, NONE },
00583 // params[0] = -1 for toggle, 0 for off, 1 for on
00584 void ActionGodMode(int *params)
00585 {
00586   if (params[0] == -1)
00587     cheat.toggle_god();
00588   else
00589     cheat.set_god(params[0] != 0);
00590 }
00591 
00592 //  { ActionGender, 0, "Change gender", true, true, NONE },
00593 void ActionGender(int *params)
00594 {
00595   cheat.change_gender();
00596 }
00597 
00598 //  { ActionCheatHelp, 0, "List cheat keys", true, true, NONE },
00599 void ActionCheatHelp(int *params)
00600 {
00601   keybinder->ShowCheatHelp();
00602 }
00603 
00604 //  { ActionInfravision, 1, "Toggle infravision", true, true, NONE },
00605 // params[0] = -1 for toggle, 0 for off, 1 for on
00606 void ActionInfravision(int *params)
00607 {
00608   if (params[0] == -1)
00609     cheat.toggle_infravision();
00610   else
00611     cheat.set_infravision(params[0] != 0);
00612 }
00613 
00614 //  { ActionSkipLift, 1, "Change skiplift", true, true, NONE },
00615 // params[0] = level, or -1 to decrease one
00616 void ActionSkipLift(int *params)
00617 {
00618   if (params[0] == -1)
00619     cheat.dec_skip_lift();
00620   else
00621     cheat.set_skip_lift(params[0]);
00622 }
00623 
00624 //  { ActionLevelup, 1, "Level-up party", true, true, NONE },
00625 // params[0] = nr. of levels (or -1 for one)
00626 void ActionLevelup(int *params)
00627 {
00628   if (params[0] == -1) params[0] = 1;
00629   for (int i=0; i < params[0]; i++)
00630     cheat.levelup_party();
00631 }
00632 
00633 //  { ActionMapEditor, 1, "Toggle map-editor mode", true, true, NONE },
00634 // params[0] = -1 for toggle, 0 for off, 1 for on
00635 void ActionMapEditor(int *params)
00636 {
00637   if (params[0] == -1)
00638     cheat.toggle_map_editor();
00639   else
00640     cheat.set_map_editor(params[0] != 0);
00641 }
00642 
00643 // { ActionHackMover, "Toggle hack-mover mode", true, true, NONE },
00644 // params[0] = -1 for toggle, 0 for off, 1 for on
00645 void ActionHackMover(int *params)
00646 {
00647   if (params[0] == -1)
00648     cheat.toggle_hack_mover();
00649   else
00650     cheat.set_hack_mover(params[0] != 0);
00651 }
00652 
00653 //  { ActionMapTeleport, 0, "Map teleport", true, true, NONE },
00654 void ActionMapTeleport(int *params)
00655 {
00656   cheat.map_teleport();
00657 }
00658 
00659 //  { ActionTeleport, 0, "Teleport to cursor", true, true, NONE },
00660 void ActionTeleport(int *params)
00661 {
00662   cheat.cursor_teleport();
00663 }
00664 
00665 //  { ActionTime, 0, "Next time period", true, true, NONE },
00666 void ActionTime(int *params)
00667 {
00668   cheat.fake_time_period();
00669 }
00670 
00671 //  { ActionWizard, 1, "Toggle archwizard mode", true, true, NONE },
00672 // params[0] = -1 for toggle, 0 for off, 1 for on
00673 void ActionWizard(int *params)
00674 {
00675   if (params[0] == -1)
00676     cheat.toggle_wizard();
00677   else
00678     cheat.set_wizard(params[0] != 0);
00679 }
00680 
00681 //  { ActionHeal, 0, "Heal party", true, true, NONE },
00682 void ActionHeal(int *params)
00683 {
00684   cheat.heal_party();
00685 }
00686 
00687 //  { ActionCheatScreen, 0, "Cheat Screen", true, true, NONE },
00688 void ActionCheatScreen(int *params)
00689 {
00690   cheat.cheat_screen();
00691 }
00692 
00693 //  { ActionPickPocket, 1, "Toggle Pickpocket", true, true, NONE },
00694 // params[0] = -1 for toggle, 0 for off, 1 for on
00695 void ActionPickPocket(int *params)
00696 {
00697   if (params[0] == -1)
00698     cheat.toggle_pickpocket();
00699   else
00700     cheat.set_pickpocket(params[0] != 0);
00701 }
00702 
00703 //  { ActionPickPocket, 1, "Toggle Pickpocket", true, true, NONE },
00704 // params[0] = -1 for toggle, 0 for off, 1 for on
00705 void ActionNPCNumbers(int *params)
00706 {
00707   if (params[0] == -1)
00708     cheat.toggle_number_npcs();
00709   else
00710     cheat.set_number_npcs(params[0] != 0);
00711 }
00712 
00713 //  { ActionGrabActor, 1, "Grab Actor for Cheatscreen", true, true, NONE },
00714 // params[0] = -1 for toggle, 0 for off, 1 for on
00715 void ActionGrabActor(int *params)
00716 {
00717   if (params[0] == -1)
00718     cheat.toggle_grab_actor();
00719   else
00720     cheat.set_grab_actor(params[0] != 0);
00721 }
00722 
00723 //  { ActionCut, "Cut Selected Objects", true, false, NONE, true},
00724 void ActionCut(int *params)
00725 {
00726   cheat.cut(false);
00727 }
00728 
00729 //  { ActionCopy, "Copy Selected Objects", true, false, NONE, true},
00730 void ActionCopy(int *params)
00731 {
00732   cheat.cut(true);
00733 }
00734 
00735 //  { ActionPaste, "Paste Selected Objects", true, false, NONE, true},
00736 void ActionPaste(int *params)
00737 {
00738   cheat.paste();
00739 }
00740 
00741 //  { ActionPlayMusic, 1, "Play song", false, true, NONE },
00742 // params[0] = song nr., or -1 for next, -2 for previous
00743 void ActionPlayMusic(int *params)
00744 {
00745   static int mnum = 0;
00746 
00747   if (params[0] == -1) {
00748     Audio::get_ptr()->start_music(mnum++, 0);
00749   } else if (params[0] == -2) {
00750     if (mnum > 0)
00751       Audio::get_ptr()->start_music(--mnum, 0);
00752   } else {
00753     mnum = params[0];
00754     Audio::get_ptr()->start_music(mnum, 0);
00755   }
00756 }
00757 
00758 //  { ActionNaked, 0, "Toggle naked mode", true, true, SERPENT_ISLE },
00759 void ActionNaked(int  *params)
00760 {
00761   cheat.toggle_naked();
00762 }
00763 
00764 //  { ActionPetra, 0, "Toggle Petra mode", true, true, SERPENT_ISLE },
00765 void ActionPetra(int *params)
00766 {
00767   cheat.toggle_Petra();
00768 }
00769 
00770 //  { ActionSkinColour, 0 "Change skin colour", true, true, NONE },
00771 void ActionSkinColour(int *params)
00772 {
00773   cheat.change_skin();
00774 }
00775 
00776 //  { ActionSoundTester, 0, "Sound tester", false, true, NONE }
00777 void ActionSoundTester(int *params)
00778 {
00779   cheat.sound_tester();
00780 }
00781 
00782 void ActionTest(int *params)
00783 {
00784 }
00785 

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