Difference between revisions of "User:AVS/Spellcasting"
From VCMI Project Wiki
< User:AVS
(→GUI related interface) |
|||
Line 69: | Line 69: | ||
** set timed effects | ** set timed effects | ||
** adv map logic | ** adv map logic | ||
+ | |||
+ | = Configuration = | ||
+ | {{todo}} | ||
+ | [[Spell format]] | ||
+ | |||
+ | <syntaxhighlight lang="javascript"> | ||
+ | { | ||
+ | "spells": | ||
+ | { | ||
+ | "spellName": | ||
+ | { | ||
+ | "id": 0, | ||
+ | "effect": 0, | ||
+ | "anim": -1, | ||
+ | "ranges": [ "X", "X", "X", "X" ], | ||
+ | "effectsCommon": [{bonus format} ...] //for all spell levels | ||
+ | "effects": [ //for particular lelel, merged with effectsCommon | ||
+ | [{bonus format} ... ], //no skill | ||
+ | [{bonus format} ... ], //basic | ||
+ | [{bonus format} ... ], //adv | ||
+ | [{bonus format} ... ] //expert | ||
+ | ] | ||
+ | |||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </syntaxhighlight> |
Revision as of 09:56, 20 January 2013
Contents
Entities
Caster
- Hero
- Creature
- (*) Scriptable virtual. Fully customizable by scripts.
ISpellCaster - public interface.
Target
- Object - any object in adv map. (f.e. scuttle boat).
- (?)Tile - any tile on map (f.e. DD)
- Battle creature
- Battle obstacle
- Battle hex
- (*) Battle hero.
- there can be multiple targets.
- on adv map, if no target then it assumed hero itself (f.e. vision, viewXXX ).
- (->) target selection configuration use selector semantic similar to bonus system.
ISpellTarger - public interface.
Spell
Common interface
Used by GUI, AI, (?) Server. Readonly.
Service-oriented design version
Use singleton Handler and methods accepting TSpell as first parameter.
- (+) script-frendly
- (+) low coupling
OO design version with proxy
- CSpellInfo - proxy class. Constructs from TSpell.
- (+) more readable
- (+) low coupling
OO design version
- CSpell -
- CSpellHandler
- (+) current version
- (-) higher coupling
used by GUI
- animation
- sound
- description for spellbook
- icon for spellbook, scroll etc.
- (+) inherit all from common interface.
OO design version with proxy
- SpellView - proxy class. Header file public.
- SpellViewHandler - singleton class (hidden) Header file private: used only by implementation of SpellView and CGI.
Server interface
used by server-side handlers
- applying effects
- do damage
- set timed effects
- adv map logic
Configuration
[Todo] Spell format
{
"spells":
{
"spellName":
{
"id": 0,
"effect": 0,
"anim": -1,
"ranges": [ "X", "X", "X", "X" ],
"effectsCommon": [{bonus format} ...] //for all spell levels
"effects": [ //for particular lelel, merged with effectsCommon
[{bonus format} ... ], //no skill
[{bonus format} ... ], //basic
[{bonus format} ... ], //adv
[{bonus format} ... ] //expert
]
}
}
}