Author Topic: Cast-Spell Command  (Read 1056 times)

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Cast-Spell Command
« on: 6 December 2010, 10:45:43 »
An initial implementation of the cast-spell command is available, is can currently only apply an Effect to the 'caster'.

A test addon is available, attached to the ticket.

This addon makes use of another new (and as yet) undocumented feature, enhancements (levels, upgrades, effects...) can include a new section <point-boosts> to boost the current hp and ep points. They add the hp/ep to any existing units affectd, and to any new units of those types. Obviously a hp-boost on a freshly constructed unit is not going to do a lot, but I'm sure you guys can think of a million ways to use ep-boost.

So, the addon adds to tech an upgrade, 'spinach' (research at castle),
Code: [Select]
<upgrade>
  <image path="spinach.bmp"/>
  <!-- other boring stuff omitted -->
  <effects>
    <unit name="swordman"/>
    <unit name="guard"/>
  </effects>
  <point-boosts>
    <ep-boost value="100" />
  </point-boosts>
</upgrade>

This gives swordsmen 5 doses of spinach, which when eaten gives him 150% attack speed and doubles his attack-strength for 30 seconds,

Code: [Select]
...
   <skill>
      <type value="cast-spell" />
      <name value="eat_spinach_skill" />
      <ep-cost value="20" />
      <speed value="20" />
      <anim-speed value="200" />
      <animation path="models/swordman_standing.g3d" />
      <sound enabled="false" />
      <effects>
         <effect name="popeye_strength" bias="beneficial" stacking="overwrite" duration="30">
            <multipliers>
               <attack-strength value="2.0" />
               <attack-speed value="1.5" />
            </multipliers>
         </effect>
      </effects>
   </skill>
...
   <command>
      <type value="cast-spell"/>
      <name value="eat_spinach"/>
      <image path="../../upgrades/spinach/spinach.bmp"/>
      <unit-requirements/>
      <upgrade-requirements/>
      <affect value="self" />
      <cast-spell-skill value="eat_spinach_skill"/>
   </command>
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Cast-Spell Command
« Reply #1 on: 7 December 2010, 09:05:14 »
Sounds great, but I really wanna see the ability to use it on other units. For example, FPM was going to use this to have a priestess (?) be able to heal a unit (by giving them a large hp regen for a moment).

Eh? points boost? Sounds great! beats the heck out of using another effect with instant tick hp regeneration...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Cast-Spell Command
« Reply #2 on: 8 December 2010, 04:44:08 »
I'm thinking that using some of the parameters from the attack skill would be good, so we could give it a projectile, splash, particles, etc.  The way I'm working on using it is for a unit to cast a spell centered on itself and affecting units nearby -- weakening enemies and/or strengthening friends.  Alternatively, maybe splash could be attached to the effect, so we could have attacks that damage within radius x and have an effect within radius y?  (Think nuclear bomb: smaller explosion, big radioactive fallout.)

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Cast-Spell Command
« Reply #3 on: 11 December 2010, 03:15:02 »
Should hopefully all be possible, from an implementation point of view I was thinking, in addition to affect == 'self' there will also be 'target' and 'position'.

for self and target you will be able to apply Effects and/or Emanations, and for position only Emanations.

But you will have to wait a bit sorry, this initial implementation was actually added by accident! I probably wont be adding the other stuff for a while yet.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Cast-Spell Command
« Reply #4 on: 11 December 2010, 03:38:53 »
No worries, I've got plenty of things to keep me occupied in the mean time (like making those pink boxes go away).  Are you looking to get all of this in 0.4, or later on?