... | @@ -61,14 +61,33 @@ The Ability class essentially contains: |
... | @@ -61,14 +61,33 @@ The Ability class essentially contains: |
|
* A member of the Action enum (used to animate the character when she casts the ability)
|
|
* A member of the Action enum (used to animate the character when she casts the ability)
|
|
* A list of instances of EffectDescriptor
|
|
* A list of instances of EffectDescriptor
|
|
|
|
|
|
|
|
The Abilities a Character has access to depend on his Specy (every Character is created from a Specy).
|
|
|
|
|
|
## III) These concepts in action
|
|
## III) These concepts in action
|
|
So, here is what happens under the hood where the player presses the 'A' keys on his keyboard.
|
|
So, here is what happens under the hood where the player presses the 'A' keys on his keyboard.
|
|
The "Followed Character" (and by extension the "Followed Relayer") corresponds to the Character the player is playing.
|
|
The "Followed Character" (and by extension the "Followed Relayer") corresponds to the Character the player is playing.
|
|
|
|
|
|
**Client**
|
|
**Client**
|
|
* Client: Player presses key 'A'
|
|
* Player presses key 'A'
|
|
* Client: The signal goes through the gui modules, which calls the "tryToCastAbility(0)" method of the followed Relayer. The '0' is the number (in the list of Abilities of the followed Character) of the ability being potentially cast. The '0' corresponds to the first weapon ability (which is mapped to 'A' by default).
|
|
* The signal goes through the gui modules, which calls the "tryToCastAbility(0)" method of the followed Relayer. The '0' is the number (in the list of Abilities of the followed Character) of the ability being potentially cast. The '0' corresponds to the first weapon ability (which is mapped to 'A' by default).
|
|
* Through processes I won't describe here, the followed Relayer sends a new AbilityEvent(CasterCharacterID, 0) to the server (note that there wasn't a cooldown check, this will be done on the server)
|
|
* Through processes I won't describe here, the followed Relayer sends a new AbilityEvent(CasterCharacterID, 0) to the server (note that there wasn't a cooldown check, this will be done on the server)
|
|
|
|
|
|
**Server**
|
|
**Server**
|
|
* Server: Execute the received AbilityEvent: Gets the local instance of Ability corresponding to the ability cast by the followed Character and call its "cast" method.
|
|
* Execute the received AbilityEvent: Gets the local instance of Ability corresponding to the ability cast by the followed Character and call its "cast" method.
|
|
|
|
* The "cast" method checks the cooldown and return a list of EffectDescriptor. It's a null if the Ability was not ready to be cast. Otherwise, it's simply the list of EffectDescriptors that the Ability contains.
|
|
|
|
* If the EffectDescriptor list was not null, add the Action defined in the Ability to the caster Character (for animation purpose)
|
|
|
|
* For each EffectDescriptor in the list:
|
|
|
|
* Use the local EffectFactory to generate an instance of Effect corresponding to the EffectDescriptor
|
|
|
|
* Call the "effect" methods of the newborn Effect, passing as arguments a List containing only the ID of the caster Character, the GameContent and the ID of the caster Character. This applies the Effect and modify the GameContent accordingly.
|
|
|
|
* The AbilityEvent is sent back to all the clients, so that they can update their GameContents
|
|
|
|
|
|
|
|
## IV) How to design new abilities
|
|
|
|
Normally, if you make any mistake (declaring unconsistent things), an exception will be thrown just after launching Igniter_Main, telling you what was wrong. So you can try->fail->learn alone. **If you have question, then keep them for yourself and, above all, DO NOT TELL THEM TO ANYONE.**
|
|
|
|
|
|
## IV) How to design new abilities |
|
Yes, I'm joking. Feel free to ask questions.
|
|
\ No newline at end of file |
|
### 1) How to design (and register at the EffectFactory) new Effects
|
|
|
|
Go to EffectGeneratorRoster and copy-paste a block of code. Then modify. Go to II)/1)/b) for additional help.
|
|
|
|
Note that in order to register your newborn EffectGenerator, you'll have to define a new key in EffectKey.
|
|
|
|
### 2) How to design (and register at the AbilityFactory) new Abilities
|
|
|
|
Go to AbilityRoster and copy-paste a block of code. Then modify.
|
|
|
|
Note that in order to register your newborn AbilityGenerator, you'll have to define a new key in AbilityKey. |