stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] demogame/ccl buttons.ccl stratagus.ccl units.cc...


From: Martin Renold
Subject: [Stratagus-CVS] demogame/ccl buttons.ccl stratagus.ccl units.cc...
Date: Sun, 14 Sep 2003 07:51:59 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    demogame
Branch:         
Changes by:     Martin Renold <address@hidden>  03/09/14 07:51:58

Modified files:
        ccl            : buttons.ccl stratagus.ccl units.ccl 
        ccl/alliance   : units.ccl 
        ccl/mythical   : units.ccl 

Log message:
        merged engine changes

Patches:
Index: demogame/ccl/alliance/units.ccl
diff -u demogame/ccl/alliance/units.ccl:1.7 demogame/ccl/alliance/units.ccl:1.8
--- demogame/ccl/alliance/units.ccl:1.7 Thu Sep 11 08:17:58 2003
+++ demogame/ccl/alliance/units.ccl     Sun Sep 14 07:51:58 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: units.ccl,v 1.7 2003/09/11 12:17:58 martinxyz Exp $
+;;     $Id: units.ccl,v 1.8 2003/09/14 11:51:58 martinxyz Exp $
 
 ;;=============================================================================
 ;;     Define unit-types.
@@ -89,7 +89,6 @@
   'can-target-land
   'land-unit
   'coward
-  'harvester
   'can-gather-resource '(
        file-when-loaded "alliance/units/peasant-with-gold.png"  
        resource-id gold
@@ -107,16 +106,7 @@
        terrain-harvester )
   'organic
   'selectable-by-rectangle
-  'add-buttons '(peasant-buttons nil)
-  'sounds '(
-    selected "peasant-selected"
-    acknowledge "peasant-acknowledge"
-    ready "peasant-ready"
-    help "basic alliance voices help 1"
-    dead "basic alliance voices dead"
-    attack "peasant-attack"))
-
-(define (peasant-buttons with-goods)
+  'add-buttons '(begin
     (if (= (get-global 'button-level) 0) (begin
       (add-button 'pos 4 'icon 'icon-repair
         'key "r" 'hint "~!REPAIR"
@@ -124,10 +114,11 @@
       (add-button 'pos 5 'icon 'icon-harvest
         'key "h" 'hint "~!HARVEST LUMBER/MINE GOLD"
         'action (lambda () (command-harvest)))
-      (if with-goods
+      (if (selected-resource-loaded) (begin
+        (writes nil (string-append "Selected unit has loaded " 
(selected-resource-loaded) " resources.\n"))
         (add-button 'pos 6 'icon 'icon-return-goods-peasant
           'key "g" 'hint "RETURN WITH ~!GOODS"
-          'action (lambda () (command-return-goods))))
+          'action (lambda () (command-return-goods)))))
       (add-button 'pos 7 'icon 'icon-build-basic
         'key "b" 'hint "BUILD ~!BASIC"
         'action (lambda ()
@@ -137,20 +128,30 @@
       ; FIXME: construct some cool helper functions for the build buttons
       (add-button 'pos 1 'icon 'icon-farm
         'key "f" 
-       'hint (string-append "BUILD ~!FARM" "   " (get-cost-string 'unit-farm))
+       'hint (string-append "BUILD ~!FARM   " (get-cost-string 'unit-farm))
         'action (lambda() (command-build 'unit-farm)))
       (add-button 'pos 2 'icon 'icon-alliance-barracks
         'key "b" 
-       'hint (string-append "~!BARRACKS" "   " (get-cost-string 
'unit-alliance-barracks))
+       'hint (string-append "~!BARRACKS   " (get-cost-string 
'unit-alliance-barracks))
         'action (lambda() (command-build 'unit-alliance-barracks)))
       (add-button 'pos 3 'icon 'icon-town-hall
         'key "t" 
-       'hint (string-append "~!TOWN HALL" "   " (get-cost-string 
'unit-town-hall))
+       'hint (string-append "~!TOWN HALL   " (get-cost-string 'unit-town-hall))
         'action (lambda() (command-build 'unit-town-hall)))
       (add-button 'pos 4 'icon 'icon-elven-lumber-mill
         'key "l" 
-       'hint (string-append "BUILD ELVEN ~!LUMBER MILL" "   " (get-cost-string 
'unit-elven-lumber-mill))
+       'hint (string-append "BUILD ELVEN ~!LUMBER MILL   " (get-cost-string 
'unit-elven-lumber-mill))
         'action (lambda() (command-build 'unit-elven-lumber-mill))))))
+  'sounds '(
+    selected "peasant-selected"
+    acknowledge "peasant-acknowledge"
+    ready "peasant-ready"
+    help "basic alliance voices help 1"
+    dead "basic alliance voices dead"
+    attack "peasant-attack"))
+
+;(define (build-button pos unittype key hint)
+  
 
 (define-unit-type 'unit-ballista 'name "Ballista"
   'files '(tileset-summer "alliance/units/ballista.png")
@@ -163,7 +164,7 @@
   'tile-size '(1 1) 'box-size '(63 63)
   'sight-range 9 'computer-reaction-range 11 'person-reaction-range 9
   'basic-damage 80 'piercing-damage 0 'missile 'missile-ballista-bolt
-  'min-attack-range 1 'max-attack-range 8
+  'min-attack-range 2 'max-attack-range 8
   'weapons-upgradable 1
   'priority 70
   'points 100
@@ -338,6 +339,8 @@
   'demand 1
   'type-land
   'right-demolish
+  'demolish-range 2
+  'demolish-damage 400
   'can-attack
   'can-target-land
   'land-unit
@@ -502,7 +505,6 @@
   'type-naval
   'right-harvest
   'sea-unit 'coward
-  'harvester
   'can-gather-resource '(
       file-when-empty "alliance/units/oil_tanker_empty.png"
       file-when-loaded "alliance/units/oil_tanker_full.png"
@@ -1428,7 +1430,7 @@
   'tile-size '(2 2) 'box-size '(63 63)
   'sight-range 9 'computer-reaction-range 7 'person-reaction-range 7
   'armor 20 'basic-damage 50 'piercing-damage 0 'missile 'missile-small-cannon
-  'min-attack-range 1 'max-attack-range 7
+  'min-attack-range 2 'max-attack-range 7
   'priority 40 'annoy-computer-factor 50
   'points 250
   'corpse '(unit-destroyed-2x2-place 0)
Index: demogame/ccl/buttons.ccl
diff -u demogame/ccl/buttons.ccl:1.2 demogame/ccl/buttons.ccl:1.3
--- demogame/ccl/buttons.ccl:1.2        Wed Sep  3 09:16:46 2003
+++ demogame/ccl/buttons.ccl    Sun Sep 14 07:51:58 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: buttons.ccl,v 1.2 2003/09/03 13:16:46 martinxyz Exp $
+;;     $Id: buttons.ccl,v 1.3 2003/09/14 11:51:58 martinxyz Exp $
 
 ; Shortcut scripts for common button types, as well as some central
 ; hooks
@@ -37,22 +37,19 @@
 (define (get-global symbol)
   (symbol-value symbol nil))
 
-;;----------------------------------------------------------------------------
-;;     Add action buttons to the UI (while the game is running).
-;;
-;;      (add-button 'pos n 'icon ident 'action actionfunc
-;;              ['key key 'hint hintstring])
-;;
-
-;; FIXME: document all the commands somewhere
+; just a shortcut around to avoid the ugly strcmp
+(define (selected-action-is actionstr)
+  (= (strcmp (selected-get-action) actionstr) 0))
 
 ;
 ; Move and Stop, always visible for moveable units
 ;
 (define (generic-movement-buttons)
+  ;(writes nil (string-append "Selected-get-action: " (selected-get-action) 
"\n"))
   (add-button 'pos 1
     'icon 'icon-move-peasant
     'key "m" 'hint "~!MOVE TO"
+    'highlight (selected-action-is 'Move)
     'action (lambda () (command-move)))
   (add-button 'pos 2
     ; FIXME: check for shield upgrades to choose icon
@@ -69,6 +66,7 @@
     ; FIXME: check for sword upgrades to choose icon
     'icon (string-append "icon-sword1")
     'key "a" 'hint "~!ATTACK"
+    'highlight (= (strcmp (selected-get-action) 'Attack) 0)
     'action (lambda () (command-attack))))
 (define (patrol-button)
   (add-button 'pos 4
@@ -121,12 +119,9 @@
 ; called first anyway
 (set-global 'button-level 0)
 
-; This hook catches all kind of upgrades. There might be new buttons
-; available, or an icon needs to be changed, etc.
 (set-selected-unit-changed-hook '(begin
   (rebuild-buttons)))
 
-; The player selected an other set of units.
 (set-selection-changed-hook '(begin
   (set-global 'button-level 0)
   (rebuild-buttons)))
Index: demogame/ccl/mythical/units.ccl
diff -u demogame/ccl/mythical/units.ccl:1.6 demogame/ccl/mythical/units.ccl:1.7
--- demogame/ccl/mythical/units.ccl:1.6 Thu Sep 11 08:17:59 2003
+++ demogame/ccl/mythical/units.ccl     Sun Sep 14 07:51:58 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: units.ccl,v 1.6 2003/09/11 12:17:59 martinxyz Exp $
+;;     $Id: units.ccl,v 1.7 2003/09/14 11:51:58 martinxyz Exp $
 
 ;;=============================================================================
 ;;     Define unit-types.
@@ -85,7 +85,6 @@
   'can-target-land
   'land-unit
   'coward
-  'harvester
   'can-gather-resource '(
        file-when-loaded "mythical/units/faun-with-gold.png"
        resource-id gold
@@ -122,7 +121,7 @@
   'tile-size '(1 1) 'box-size '(63 63)
   'sight-range 9 'computer-reaction-range 11 'person-reaction-range 9
   'basic-damage 80 'piercing-damage 0 'missile 'missile-catapult-rock
-  'min-attack-range 1 'max-attack-range 8
+  'min-attack-range 2 'max-attack-range 8
   'weapons-upgradable 1
   'priority 70
   'points 100
@@ -293,6 +292,8 @@
   'demand 1
   'type-land
   'right-demolish
+  'demolish-range 2
+  'demolish-damage 400
   'can-attack
   'can-target-land
   'land-unit
@@ -461,7 +462,6 @@
   'type-naval
   'right-harvest
   'sea-unit 'coward
-  'harvester
   'can-gather-resource '(
         file-when-empty "alliance/units/oil_tanker_empty.png"
         file-when-loaded "alliance/units/oil_tanker_full.png"
@@ -1454,7 +1454,7 @@
   'tile-size '(2 2) 'box-size '(63 63)
   'sight-range 9 'computer-reaction-range 7 'person-reaction-range 7
   'armor 20 'basic-damage 50 'piercing-damage 0 'missile 'missile-small-cannon
-  'min-attack-range 1 'max-attack-range 7
+  'min-attack-range 2 'max-attack-range 7
   'priority 40 'annoy-computer-factor 50
   'points 250
   'corpse '(unit-destroyed-2x2-place 0)
Index: demogame/ccl/stratagus.ccl
diff -u demogame/ccl/stratagus.ccl:1.4 demogame/ccl/stratagus.ccl:1.5
--- demogame/ccl/stratagus.ccl:1.4      Wed Sep  3 07:23:07 2003
+++ demogame/ccl/stratagus.ccl  Sun Sep 14 07:51:58 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: stratagus.ccl,v 1.4 2003/09/03 11:23:07 martinxyz Exp $
+;;     $Id: stratagus.ccl,v 1.5 2003/09/14 11:51:58 martinxyz Exp $
 
 ;; For documentation see stratagus/doc/ccl/ccl.html
 
@@ -362,7 +362,8 @@
 ;;-----------------------------------------------------------------------------
 
 ; for the AI
-(a-star 'on 'fixed-unit-cost 1000 'moving-unit-cost 20 
'dont-know-unseen-terrain 'unseen-terrain-cost 2)
+(a-star 'fixed-unit-cost 1000 'moving-unit-cost 20 'dont-know-unseen-terrain 
'unseen-terrain-cost 2)
+
 
 ;;-----------------------------------------------------------------------------
 
Index: demogame/ccl/units.ccl
diff -u demogame/ccl/units.ccl:1.5 demogame/ccl/units.ccl:1.6
--- demogame/ccl/units.ccl:1.5  Thu Sep 11 08:17:58 2003
+++ demogame/ccl/units.ccl      Sun Sep 14 07:51:58 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: units.ccl,v 1.5 2003/09/11 12:17:58 martinxyz Exp $
+;;     $Id: units.ccl,v 1.6 2003/09/14 11:51:58 martinxyz Exp $
 
 ;; Load the animations for the units.
 (load "ccl/anim.ccl" #f #t)
@@ -168,6 +168,8 @@
   'can-target-land
   'land-unit
   'critter
+  'random-movement-probability 100
+  'clicks-to-explode 10
   'organic
   'sounds '(
     selected "critter-selected"




reply via email to

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