___________ _________ _____ __
\_ _____/______ ____ ____ \_ ___ \____________ _/ ____\/ |_
| __) \_ __ \_/ __ \_/ __ \/ \ \/\_ __ \__ \\ __\\ __|
| \ | | \/\ ___/\ ___/\ \____| | \// __ \| | | |
\___ / |__| \___ >\___ >\______ /|__| (____ /__| |__|
\/ \/ \/ \/ \/
______________________ ______________________
T H E W A R B E G I N S
FreeCraft - A free fantasy real time strategy game engine
(C) Copyright 1998-2003 by The FreeCraft Project. Distributed under the "GNU General Public License"
(define-animations ident 'still script 'move script 'die script 'attack script)
A script is a list of quad numbers. (#(Flags Pixel Sleep Frame) (#Flags Pixel Sleep Frame) ...) * Format of quad numbers: #(Flags Pixel Sleep Frame) o Flags are the sum of the following: 1 Restart - restart animation 2 Reset - animation could here be aborted (switch to another) 4 Sound - play a sound with the animation 8 Missile - fire a missile at this point o Pixel is the number of pixels to move (if this is a moving animation) o Sleep is the number of frames to wait for the next animation o Frame is increment to the frame of the image
(define-animations 'animation-footman
'still '( ; #5
#( 0 0 4 0) #( 3 0 1 0))
'move '( ; #16 P32
#( 0 3 2 0) #( 0 3 1 5) #( 0 3 2 5) #( 0 2 1 10)
#( 0 3 1 10) #( 0 2 1 0) #( 0 3 2 0) #( 0 3 1 15)
#( 0 3 2 15) #( 0 2 1 20) #( 0 3 1 20) #( 3 2 1 0))
'attack '( ; #25
#( 0 0 3 25) #( 0 0 3 30) #( 0 0 3 35) #(12 0 5 40)
#( 0 0 10 0) #( 3 0 1 0))
'die '( ; #107
#( 0 0 3 45) #( 0 0 3 50) #( 0 0 100 55) #( 3 0 1 55)))
Defines the animations for the footman.
(define-unit-stats ident player 'level level 'speed speed 'attack-range arange
'sight-range srange 'armor armor 'basic-damage bdamage 'piercing-damage pdamage
'hit-points hp 'costs costs)
(define-unit-stats)
.
The default unit types are defined in $FREECRAFT_LIBRARY/data/units.ccl and $FREECRAFT_LIBRARY/data/human/units.ccl and $FREECRAFT_LIBRARY/data/orc/units.ccl. This could also be defined in own levels.
(define-unit-type ident name graphics pixel_size animations icon
speed overlay sight_range hitpoints magic costs tile_size box_size
attack_range computer_reaction_range human_reaction_range armor
priorty damage piercing_damge weapon_upgradable armor_upgradeable
decay annoy_factor points missle corpse type right_mouse can_target
flags sounds attack_sound)
Examples:
NOTE: This is extendable more costs could be added. (using 6 resources insteed of 3. Or redefining the gold resource into a crytal resource)
(define-unit-type "unit-footman" "Footman"
;; graphic data
#("footman.png"
()
()
() )
'( 72 72 ) ;; graphic size
"animations-footman" ;; animations
"icon-footman"
;;Speed OvFrame SightR Hitpnt Magic BTime Gold Wood Oil
10 0 4 60 0 #( 60 600 0 0 )
;;Tile Box Size Attack ReactC ReactH
'( 1 1 ) '( 31 31 ) 1 6 4
;;Armor Prior Damage Pierc WUpgr AUpgr
2 60 6 3 1 1
;;Decay Annoy Points
0 0 50
"missile-none"
'corpse-human
'type-land
'right-attack
'can-target-land
;; flags
'land-unit
'can-attack
'organic
'selectable-by-rectangle
;; sounds
#("footman-selected"
"footman-acknowledge"
"footman-ready"
"footman-help"
"footman-dead" )
"footman-attack" )
Define the unit-type "unit-footman" as footman.(define-unittype-wc-names footman grunt ...)
(define-unittype-wc-names)
.
(get-unit-type-ident unit-type)
(get-unit-type-ident)
.
(get-unit-type-property unit-type)
(get-unit-type-property)
.
(get-unit-type-name unit-type)
(get-unit-type-name)
.
(set-unit-type-name! unit-type name)
(set-unit-type-name!)
.
(set-unit-type-property unit-type property)
(set-unit-type-property)
.
(unit-type ident)
(unit-type 'unit-great-hall)
.
(unit-type-array)
(unit-type-array)
.