stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus data/ccl/spells.ccl src/clone/unit_dr...


From: Crestez Leonard
Subject: [Stratagus-CVS] stratagus data/ccl/spells.ccl src/clone/unit_dr...
Date: Sat, 25 Oct 2003 17:05:34 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Crestez Leonard <address@hidden>        03/10/25 17:05:33

Modified files:
        data/ccl       : spells.ccl 
        src/clone      : unit_draw.c 
        src/editor     : editloop.c 
        src/include    : editor.h 
        src/ui         : menus.c 

Log message:
        Fixed nit-pick editor selection bug.

Patches:
Index: stratagus/data/ccl/spells.ccl
diff -u stratagus/data/ccl/spells.ccl:1.15 stratagus/data/ccl/spells.ccl:1.16
--- stratagus/data/ccl/spells.ccl:1.15  Sat Oct 25 14:58:41 2003
+++ stratagus/data/ccl/spells.ccl       Sat Oct 25 17:05:32 2003
@@ -26,64 +26,10 @@
 ;;      along with this program; if not, write to the Free Software

 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA

 ;;

-;;     $Id: spells.ccl,v 1.15 2003/10/25 18:58:41 n0body Exp $

+;;     $Id: spells.ccl,v 1.16 2003/10/25 21:05:32 n0body Exp $

 

 ;; For documentation see stratagus/doc/ccl/ccl.html ;; FIXME write and move 
doc.

 

-;;             // Warning, Some names and specifications should be changed

-;;             // Todo parameter coherency ? negative for dealing damage, 
positive for healing ?

-;;

-;;             ...             : for list.

-;;             {a, b, c}       : choice between a, b, or c.

-;;             name#n          : name is of type number.

-;;             #n                      : Number.

-;;             #t                      : {true, false}

-;;             #target         : {'self, 'Unit, 'position}

-;;             #f_inv          : {unholyarmor, invisibility}

-;;             #f_haste        : {bloodlust, slow, haste, HP, mana, 
HP_percent, mana_percent}

-;;             #f_flag         : {invisibility, bloodlust, unholyarmor, slow, 
haste, flameshield,

-;;                               HP, mana, HP_percent, mana_percent

-;;             #flagtype       : {coward, organic, undead, canattack, building}

-;;             <condition>     : Same syntax as 'condition

-;;

-;;     (define-spell   "IdentName"     // Ident name for call in unit

-;;             'Showname "ShowName"    // Name show in the engine

-;;             'ManaCost #n            // Mana to cast the spell

-;;             'range #n               // Range of the spell (0)

-;;             'Target #target         // Which target is allowed (None by 
default)

-;;             'Action '({

-;;                     Blizzard ('fields #n 'shards #n 'damage #n),

-;;                     CircleOfPower "unit-goal",

-;;                     DeathAndDecay(fields #n shards #n damage #n),

-;;                     DeathCoil,

-;;                     FireBall (ttl #n damage #n),

-;;                     FlameShield (ttl #n),

-;;                     Haste (#f_haste #n ...),

-;;                     Healing (HP#n), // Healing (HP >0) or exorcism (HP < 0)

-;;                     HolyVision "unit-revealer",

-;;                     Invisibility (flag #f_inv value #n missile 
"MissileType")

-;;                     Polymorph "unittype",

-;;                     RaiseDead "skeleton",

-;;                     Runes (ttl #n damage #n),

-;;                     Summon "UnitType",

-;;                     Whirlwind (ttl #n)

-;;                             } )

-;;             'sound-when-cast "SoundConfig"

-;;             'missile-when-cast "MissileType"

-;;             'condition '( {

-;;                     Enemypresence   (#t range #n),                  // 
enemy in range

-;;                     DurationEffect  (#t flag #f_flag value #n),     // 
"f_flag" < #n

-;;                     Alliance        #t,                             // 
check the target is allied.

-;;                     UnitTypeflag    (#t #flagtype),                 // Unit 
is a "type"

-;;                     ...}

-;;                     )

-;;             'autocast '(

-;;                             range #n

-;;                             condition (<condition>)// Additional condition

-;;                             +++order () // which target choose.

-;;                             )

-;;

-

 (define-bool-flags 'isundead 'organic 'hero)

 

 ;;  Declare some unit types used in spells. This is quite accetable, the other

@@ -125,12 +71,7 @@
            max-hp-percent 100)

        'sound-when-cast "healing"

        'missile-when-cast "missile-heal-effect"

-       'autocast '(range 6

-           condition (

-               coward false

-               alliance only

-               max-hp-percent 50

-           )

+       'autocast '(range 6 condition (alliance only max-hp-percent 90 )

        )

 )

 

@@ -187,8 +128,8 @@
            max-slow-ticks 10)

        'sound-when-cast "slow"

        'missile-when-cast "missile-normal-spell"

-       'autocast '(range 10 combat only condition (coward false alliance 
false))

-       'ai-cast '(range 10 condition (coward false alliance false))

+       'autocast '(range 10 condition (coward false alliance false))

+       'ai-cast '(range 10 combat only condition (coward false alliance false))

 )

 

 (define-spell "spell-bloodlust"

@@ -251,7 +192,7 @@
        'condition '(building false)

        'sound-when-cast "flame shield"

        'missile-when-cast "missile-flame-shield" ; NOT use

-;      'autocast '(range 6 condition (coward false))

+;;     'autocast '(range 6 condition (coward false))

 )

 

 (define-spell "spell-polymorph"

Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.173 
stratagus/src/clone/unit_draw.c:1.174
--- stratagus/src/clone/unit_draw.c:1.173       Thu Oct 23 21:58:33 2003
+++ stratagus/src/clone/unit_draw.c     Sat Oct 25 17:05:32 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit_draw.c,v 1.173 2003/10/24 01:58:33 n0body Exp $
+//     $Id: unit_draw.c,v 1.174 2003/10/25 21:05:32 n0body Exp $
 
 //@{
 
@@ -41,6 +41,7 @@
 #include "video.h"
 #include "sound_id.h"
 #include "unitsound.h"
+#include "editor.h"
 #include "unittype.h"
 #include "player.h"
 #include "unit.h"
@@ -114,6 +115,11 @@
 */
 local VMemType* SelectionColor(const Unit* unit)
 {
+    if (EditorRunning && unit==UnitUnderCursor &&
+           EditorState == EditorSelecting) {
+       return &ColorWhite;
+    }
+
     if (unit->Selected || (unit->Blink & 1)) {
        if (unit->Player->Player == PlayerNumNeutral) {
            return &ColorYellow;
@@ -577,7 +583,7 @@
 global void SaveDecorations(CLFile* file)
 {
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.173 
2003/10/24 01:58:33 n0body Exp $\n\n");
+    CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.174 
2003/10/25 21:05:32 n0body Exp $\n\n");
 
     CLprintf(file, "(mana-sprite \"%s\"  %d %d  %d %d)\n",
        ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -1931,8 +1937,8 @@
        drawlevel2 = c2->Type->DrawLevel;
     }
     if (drawlevel1 == drawlevel2) {
-       return c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth + c2->X ? 
-           c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth + c2->X : 
+       return c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth - c2->X ? 
+           c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth - c2->X : 
            c1->Slot - c2->Slot;
     } else {
        return drawlevel1 <= drawlevel2 ? -1 : 1;
Index: stratagus/src/editor/editloop.c
diff -u stratagus/src/editor/editloop.c:1.137 
stratagus/src/editor/editloop.c:1.138
--- stratagus/src/editor/editloop.c:1.137       Sat Oct 25 14:58:42 2003
+++ stratagus/src/editor/editloop.c     Sat Oct 25 17:05:32 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: editloop.c,v 1.137 2003/10/25 18:58:42 n0body Exp $
+//     $Id: editloop.c,v 1.138 2003/10/25 21:05:32 n0body Exp $
 
 //@{
 
@@ -76,11 +76,7 @@
 global char EditorRunning;             /// True editor is running
 global char EditorMapLoaded;           /// Map loaded in editor
 
-local enum _editor_state_ {
-    EditorSelecting,                   /// Select
-    EditorEditTile,                    /// Edit tiles
-    EditorEditUnit,                    /// Edit units
-} EditorState;                         /// Current editor state
+global EditorStateType EditorState;    /// Current editor state.
 
 local char TileToolRandom;             /// Tile tool draws random
 local char TileToolDecoration;         /// Tile tool draws with decorations
@@ -791,7 +787,13 @@
                TileSizeY * TileCursorSize);
            SetClipping(0, 0, VideoWidth - 1, VideoHeight - 1);
        } else {
-           VideoDrawRectangle(ColorWhite, x, y, TileSizeX, TileSizeY);
+           //
+           //  If there is an unit under the cursor, it's selection thing
+           //  is drawn somewhere else (Check DrawUnitSelection.)
+           //
+           if (!UnitUnderCursor) {
+               VideoDrawRectangle(ColorWhite, x, y, TileSizeX, TileSizeY);
+           }
        }
     }
 }
Index: stratagus/src/include/editor.h
diff -u stratagus/src/include/editor.h:1.19 stratagus/src/include/editor.h:1.20
--- stratagus/src/include/editor.h:1.19 Fri Jul 11 10:35:30 2003
+++ stratagus/src/include/editor.h      Sat Oct 25 17:05:33 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: editor.h,v 1.19 2003/07/11 14:35:30 n0body Exp $
+//     $Id: editor.h,v 1.20 2003/10/25 21:05:33 n0body Exp $
 
 #ifndef __EDITOR_H__
 #define __EDITOR_H__
@@ -41,6 +41,14 @@
 extern char EditorRunning;
     /// Map loaded in editor
 extern char EditorMapLoaded;
+    /// Current editor state type.
+typedef enum _editor_state_type_ {
+    EditorSelecting,                   /// Select
+    EditorEditTile,                    /// Edit tiles
+    EditorEditUnit,                    /// Edit units
+} EditorStateType;                     /// Current editor state
+    /// Current editor state.
+extern EditorStateType EditorState;
 
     /// Editor CCL start file
 extern const char* EditorStartFile;
Index: stratagus/src/ui/menus.c
diff -u stratagus/src/ui/menus.c:1.573 stratagus/src/ui/menus.c:1.574
--- stratagus/src/ui/menus.c:1.573      Sat Oct 25 16:59:23 2003
+++ stratagus/src/ui/menus.c    Sat Oct 25 17:05:33 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: menus.c,v 1.573 2003/10/25 20:59:23 mohydine Exp $
+//     $Id: menus.c,v 1.574 2003/10/25 21:05:33 n0body Exp $
 
 //@{
 
@@ -470,7 +470,8 @@
 /**
 **     Initialize the hash table of menu functions
 */
-global void InitMenuFuncHash(void) {
+global void InitMenuFuncHash(void)
+{
     HASHADD(NULL,"null");
 
 // Game menu




reply via email to

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