Author Topic: [fixed] Units don't loose life with attackboost (patch)  (Read 753 times)

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
SVN Head rev: 3229

The attackboost <max-hp value="0" regeneration="-15"/> is shown at the unit (foe) but it has no effect. Maybe the problem is that regeneration +-15 is shown.

full xml of the unit casing attackboost:
Code: [Select]
<?xml version="1.0" standalone="no" ?>
<unit>
   <!-- *** parameters *** -->
   <parameters>
      <size value="1" />
      <height value="0" />
      <max-hp value="49" regeneration="-1"/>
      <max-ep value="0"/>
      <armor value="0" />
      <armor-type value="runes"/>           
      <sight value="0" />
      <time value="1" />
      <multi-selection value="false" />
      <cellmap value="true"  allowEmpty="true" >
      <row value="0"/>
      </cellmap>
      <levels/>
      <fields>
         <field value="land" />
      </fields>
      <properties>
      </properties>
      <light enabled="false" />
      <unit-requirements/>
      <upgrade-requirements />
      <resource-requirements>
         <resource name="gold" amount="0"/>
      </resource-requirements>
      <resources-stored />     
      <image path="images/gold.bmp"/>
      <image-cancel path="images/tech_stop.bmp"/>
      <meeting-point value="false"/>
      <selection-sounds enabled="false"/>
      <command-sounds enabled="false"/>
   </parameters>
   
   <!-- *** skills *** -->
   <skills>
     
      <skill>
         <type value="stop" />
         <name value="stop_skill"/>     
         <ep-cost value="0" />
         <speed value="300" />
         <anim-speed value="10" />
         <animation path="models/iceaura.g3d" />
         <sound enabled="false" />
         <attack-boost name="fireeffect">
            <allow-multiple-boosts value="false" />
            <radius value="3"/>
                <target value="foe"/>
            <max-hp value="0" regeneration="-15"/>
            <max-ep value="0"  regeneration="0"/>
            <sight value="0"/>
            <attack-strenght value="0"/>
            <attack-range value="0"/>
            <armor value="0"/>
            <move-speed value="0"/>
            <production-speed value="0"/>
            <particles value="true">
               <affected-particle-file path="fire_particles.xml"/>
            </particles>
            </attack-boost>
         <particles value="false">
            <particle-file path="glow_particles.xml"/>
         </particles>
      </skill>   
      <skill>
         <type value="be_built" />
         <name value="be_built_skill" />
         <ep-cost value="0" />
         <speed value="300" />
         <anim-speed value="300" />
         <animation path="models/iceaura.g3d" />
         <sound enabled="false">
         </sound>
      </skill>
     
      <skill>
         <type value="die" />
         <name value="die_skill"/>     
         <ep-cost value="0" />
         <speed value="300" />
         <anim-speed value="300" />
         <animation path="models/none.g3d" />
         <sound enabled="false"/>     
         <fade value="false"/>
      </skill>
      <skill>
         <type value="attack"/>
         <name value="attack_skill"/>     
         <ep-cost value="0"/>
         <speed value="50"/>
         <anim-speed value="50"/>
         <animation path="models/none.g3d"/>
         <sound enabled="false" start-time="0.5" />
         <attack-strenght value="50"/>
         <attack-var value="0"/>
         <attack-range value="1"/>
         <attack-type value="fire"/>
         <attack-start-time value="0.5"/>
         <attack-fields>
            <field value="land"/>
            <field value="air"/>
         </attack-fields>
           

         <projectile value="false" />
         <splash value="false"/>
      </skill>

   </skills>
   
   <!-- *** commands *** -->
   <commands>
     
      <command>           
         <type value="attack_stopped"/>         
         <name value="attack_on"/>         
         <image path="images/tech_stop.bmp"/>         
         <unit-requirements/>         
         <upgrade-requirements/>         
         <attack-skill value="attack_skill"/>         
            <stop-skill value="stop_skill"/>                 
      </command>
      </commands>
</unit>
« Last Edit: 11 April 2012, 11:51:05 by tomreyn »

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
i already found out this but forget to post it :)
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Here is the patch to fix that bug

Code: [Select]
Index: glest_game/types/unit_type.cpp
===================================================================
--- glest_game/types/unit_type.cpp (revision 3229)
+++ glest_game/types/unit_type.cpp (working copy)
@@ -837,7 +837,7 @@
 int UnitType::getTotalMaxHpRegeneration(const TotalUpgrade *totalUpgrade) const {
  checkItemInVault(&(this->hpRegeneration),this->hpRegeneration);
  int result = hpRegeneration + totalUpgrade->getMaxHpRegeneration();
- result = max(0,result);
+ //result = max(0,result);
  return result;
 }
 
@@ -851,7 +851,7 @@
 int UnitType::getTotalMaxEpRegeneration(const TotalUpgrade *totalUpgrade) const {
  checkItemInVault(&(this->epRegeneration),this->epRegeneration);
  int result = epRegeneration + totalUpgrade->getMaxEpRegeneration();
- result = max(0,result);
+ //result = max(0,result);
  return result;
 }
 

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Fixed in svn, i double checked and this change seems fine and does not have bad side effects.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: [fixed] Units don't loose life with attackboost (patch)
« Reply #4 on: 11 April 2012, 12:41:24 »
I had some concerns about some unwanted effects on buildings beeing build , but I was too tired to finish this yesterday. Thanks that you did it  :thumbup:
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios