stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/clone ccl.c unit.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/clone ccl.c unit.c
Date: 16 Dec 2003 07:07:21 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       03/12/16 07:07:20

Modified files:
        src/clone      : ccl.c unit.c 

Log message:
        Added SetGodMode, changed GodMode damage to kill with one hit

Patches:
Index: stratagus/src/clone/ccl.c
diff -u stratagus/src/clone/ccl.c:1.146 stratagus/src/clone/ccl.c:1.147
--- stratagus/src/clone/ccl.c:1.146     Fri Dec 12 08:47:44 2003
+++ stratagus/src/clone/ccl.c   Tue Dec 16 07:07:18 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl.c,v 1.146 2003/12/11 21:47:44 jsalmon3 Exp $
+//     $Id: ccl.c,v 1.147 2003/12/15 20:07:18 jsalmon3 Exp $
 
 //@{
 
@@ -791,6 +791,24 @@
 #endif
 
 /**
+**     Set God mode.
+**
+**     @return         The old mode.
+*/
+#if defined(USE_LUA)
+local int CclSetGodMode(lua_State* l)
+{
+    if (lua_gettop(l) != 1) {
+       lua_pushstring(l, "incorrect argument");
+       lua_error(l);
+    }
+    lua_pushboolean(l, GodMode);
+    GodMode = LuaToBoolean(l, 1);
+    return 0;
+}
+#endif
+
+/**
 **     Enable/disable Showing the tips at the start of a level.
 **
 **     @param flag     True = turn on, false = off.
@@ -1779,6 +1797,7 @@
     lua_register(Lua, "SetGamePaused", CclSetGamePaused);
     lua_register(Lua, "SetVideoSyncSpeed", CclSetVideoSyncSpeed);
     lua_register(Lua, "SetLocalPlayerName", CclSetLocalPlayerName);
+    lua_register(Lua, "SetGodMode", CclSetGodMode);
 
     lua_register(Lua, "SetShowTips", CclSetShowTips);
     lua_register(Lua, "SetCurrentTip", CclSetCurrentTip);
@@ -2022,7 +2041,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.146 2003/12/11 21:47:44 jsalmon3 Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.147 2003/12/15 20:07:18 jsalmon3 Exp $\n");
 
     fprintf(fd, "(set-video-resolution! %d %d)\n", VideoWidth, VideoHeight);
     fprintf(fd, "(set-group-keys \"");
@@ -2054,7 +2073,7 @@
     }
 
     fprintf(fd, "--- -----------------------------------------\n");
-    fprintf(fd, "--- $Id: ccl.c,v 1.146 2003/12/11 21:47:44 jsalmon3 Exp $\n");
+    fprintf(fd, "--- $Id: ccl.c,v 1.147 2003/12/15 20:07:18 jsalmon3 Exp $\n");
 
     fprintf(fd, "SetVideoResolution(%d, %d)\n", VideoWidth, VideoHeight);
     fprintf(fd, "SetGroupKeys(\"");
@@ -2092,7 +2111,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.146 2003/12/11 21:47:44 jsalmon3 Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.147 2003/12/15 20:07:18 jsalmon3 Exp $\n");
 
     // Global options
     if (OriginalFogOfWar) {
@@ -2173,7 +2192,7 @@
     }
 
     fprintf(fd, "--- -----------------------------------------\n");
-    fprintf(fd, "--- $Id: ccl.c,v 1.146 2003/12/11 21:47:44 jsalmon3 Exp $\n");
+    fprintf(fd, "--- $Id: ccl.c,v 1.147 2003/12/15 20:07:18 jsalmon3 Exp $\n");
 
     // Global options
     if (OriginalFogOfWar) {
@@ -2296,7 +2315,7 @@
     extern SCM oblistvar;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.146 2003/12/11 21:47:44 
jsalmon3 Exp $\n\n");
+    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.147 2003/12/15 20:07:18 
jsalmon3 Exp $\n\n");
 
     for (list = oblistvar; gh_list_p(list); list = gh_cdr(list)) {
        SCM sym;
Index: stratagus/src/clone/unit.c
diff -u stratagus/src/clone/unit.c:1.347 stratagus/src/clone/unit.c:1.348
--- stratagus/src/clone/unit.c:1.347    Wed Dec 10 19:22:05 2003
+++ stratagus/src/clone/unit.c  Tue Dec 16 07:07:19 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit.c,v 1.347 2003/12/10 08:22:05 wizzard Exp $
+//     $Id: unit.c,v 1.348 2003/12/15 20:07:19 jsalmon3 Exp $
 
 //@{
 
@@ -2922,7 +2922,7 @@
 
     if (GodMode) {
        if (attacker && attacker->Player == ThisPlayer) {
-           damage = 255;
+           damage = target->HP;
        }
        if (target->Player == ThisPlayer) {
            damage = 0;
@@ -3723,7 +3723,7 @@
     int RunStart;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.347 2003/12/10 08:22:05 
wizzard Exp $\n\n");
+    CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.348 2003/12/15 20:07:19 
jsalmon3 Exp $\n\n");
 
     //
     // Local variables




reply via email to

[Prev in Thread] Current Thread [Next in Thread]