Page MenuHomeWildfire Games

Change mauryan healer hero inheritance
ClosedPublic

Authored by fatherbushido on Sep 16 2017, 5:10 PM.

Details

Summary

To allow better maintenance, create a generic template_hero_healer template (dogs have their own ones too) and make the mauryan healer hero inherit from it.

(My personal *feeling* is that inheritence would be perhaps better with functions instead of cs/champ/hero but I am also fine with the current system. So current patch is to match the current system).

I didn't change anything except adding the loot. The goal of the patch is not to fix that template (sounds are missing for example) but to allow that task to be done.

Test Plan

Old one was

{
    '@parent':"template_unit",
    AIProxy:(void 0),
    Armour:{
        Crush:"4.0",
        Hack:"4.0",
        Pierce:"8.0"
    },
    Auras:{
        '@datatype':"tokens",
        _string:"units/heroes/hero_garrison units/heroes/maur_hero_chanakya_1 units/heroes/maur_hero_chanakya_2"
    },
    Cost:{
        BuildTime:"40",
        Population:"2",
        PopulationBonus:"0",
        Resources:{
            food:"200",
            metal:"200",
            stone:"0",
            wood:"150"
        }
    },
    Decay:{
        Active:"false",
        DelayTime:"80.0",
        SinkAccel:"0.0",
        SinkRate:"0.01",
        SinkingAnim:"false"
    },
    Footprint:{
        Circle:{
            '@radius':"1.5"
        },
        Height:"2.5"
    },
    Garrisonable:(void 0),
    Guard:(void 0),
    Heal:{
        HP:"6",
        HealableClasses:{
            '@datatype':"tokens",
            _string:"Human"
        },
        Range:"20",
        Rate:"2000",
        UnhealableClasses:{
            '@datatype':"tokens"
        }
    },
    Health:{
        DeathType:"corpse",
        IdleRegenRate:"0",
        Max:"1000",
        RegenRate:"0",
        Undeletable:"false",
        Unhealable:"false"
    },
    Identity:{
        Civ:"maur",
        Classes:{
            '@datatype':"tokens",
            _string:"Unit ConquestCritical Human Organic"
        },
        Formations:{
            '@datatype':"tokens",
            _string:"formations/null formations/box formations/column_closed formations/line_closed formations/column_open formations/line_open formations/flank formations/battle_line"
        },
        GenericName:"Acharya Chanakya",
        Icon:"units/maur_hero_chanakya.png",
        RequiredTechnology:"phase_city",
        SpecificName:"Acharya Ch\u0101\u1E47akya",
        VisibleClasses:{
            '@datatype':"tokens",
            _string:"Healer Hero Support"
        }
    },
    Looter:(void 0),
    Minimap:{
        Type:"hero"
    },
    Obstruction:{
        Active:"true",
        BlockConstruction:"true",
        BlockFoundation:"false",
        BlockMovement:"true",
        BlockPathfinding:"false",
        DisableBlockMovement:"false",
        DisableBlockPathfinding:"false",
        Unit:(void 0)
    },
    OverlayRenderer:(void 0),
    Ownership:(void 0),
    Position:{
        Altitude:"0",
        Anchor:"upright",
        Floating:"false",
        TurnRate:"6.0"
    },
    RangeVisualization:(void 0),
    ResourceGatherer:{
        BaseSpeed:"1.0",
        Capacities:{
            food:"10",
            metal:"10",
            stone:"10",
            wood:"10"
        },
        MaxDistance:"2.0",
        Rates:{
            treasure:"1"
        }
    },
    Selectable:{
        Overlay:{
            AlwaysVisible:(void 0),
            Texture:{
                MainTexture:"star/256x256.png",
                MainTextureMask:"star/256x256_mask.png"
            }
        }
    },
    Sound:{
        SoundGroups:{
            attacked:"interface/alarm/alarm_attackplayer.xml"
        }
    },
    StatusBars:{
        BarHeight:"0.333",
        BarWidth:"2.0",
        HeightOffset:"5.0"
    },
    TrainingRestrictions:{
        Category:"Hero"
    },
    UnitAI:{
        AlertReactiveLevel:"2",
        CanGuard:"true",
        CanPatrol:"true",
        DefaultStance:"aggressive",
        FleeDistance:"12.0",
        FormationController:"false"
    },
    UnitMotion:{
        FormationController:"false",
        PassabilityClass:"default",
        Run:{
            DecayTime:"0.2",
            Range:"200.0",
            RangeMin:"0.0",
            RegenTime:"0.1",
            Speed:"12.0"
        },
        WalkSpeed:"9"
    },
    Visibility:{
        AlwaysVisible:"false",
        Corpse:"false",
        Preview:"false",
        RetainInFog:"false"
    },
    Vision:{
        Range:"30"
    },
    VisionSharing:{
        Bribable:"false"
    },
    VisualActor:{
        Actor:"units/mauryans/hero_chanakya.xml",
        SilhouetteDisplay:"true",
        SilhouetteOccluder:"false",
        VisibleInAtlasOnly:"false"
    }
}

New one is

{
    '@parent':"template_unit_hero_healer",
    AIProxy:(void 0),
    Armour:{
        Crush:"4.0",
        Hack:"4.0",
        Pierce:"8.0"
    },
    Auras:{
        '@datatype':"tokens",
        _string:"units/heroes/hero_garrison units/heroes/maur_hero_chanakya_1 units/heroes/maur_hero_chanakya_2"
    },
    Cost:{
        BuildTime:"40",
        Population:"2",
        PopulationBonus:"0",
        Resources:{
            food:"200",
            metal:"200",
            stone:"0",
            wood:"150"
        }
    },
    Decay:{
        Active:"false",
        DelayTime:"80.0",
        SinkAccel:"0.0",
        SinkRate:"0.01",
        SinkingAnim:"false"
    },
    Footprint:{
        Circle:{
            '@radius':"1.5"
        },
        Height:"2.5"
    },
    Garrisonable:(void 0),
    Guard:(void 0),
    Heal:{
        HP:"6",
        HealableClasses:{
            '@datatype':"tokens",
            _string:"Human"
        },
        Range:"20",
        Rate:"2000",
        UnhealableClasses:{
            '@datatype':"tokens"
        }
    },
    Health:{
        DeathType:"corpse",
        IdleRegenRate:"0",
        Max:"1000",
        RegenRate:"0",
        Undeletable:"false",
        Unhealable:"false"
    },
    Identity:{
        Civ:"maur",
        Classes:{
            '@datatype':"tokens",
            _string:"Unit ConquestCritical Organic Human"
        },
        Formations:{
            '@datatype':"tokens",
            _string:"formations/null formations/box formations/column_closed formations/line_closed formations/column_open formations/line_open formations/flank formations/battle_line"
        },
        GenericName:"Acharya Chanakya",
        Icon:"units/maur_hero_chanakya.png",
        RequiredTechnology:"phase_city",
        SpecificName:"Acharya Ch\u0101\u1E47akya",
        VisibleClasses:{
            '@datatype':"tokens",
            _string:"Hero Healer Support"
        }
    },
    Loot:{
        food:"10",
        metal:"25",
        stone:"0",
        wood:"0",
        xp:"400"
    },
    Looter:(void 0),
    Minimap:{
        Type:"hero"
    },
    Obstruction:{
        Active:"true",
        BlockConstruction:"true",
        BlockFoundation:"false",
        BlockMovement:"true",
        BlockPathfinding:"false",
        DisableBlockMovement:"false",
        DisableBlockPathfinding:"false",
        Unit:(void 0)
    },
    OverlayRenderer:(void 0),
    Ownership:(void 0),
    Position:{
        Altitude:"0",
        Anchor:"upright",
        Floating:"false",
        TurnRate:"6.0"
    },
    RangeVisualization:(void 0),
    ResourceGatherer:{
        BaseSpeed:"1.0",
        Capacities:{
            food:"10",
            metal:"10",
            stone:"10",
            wood:"10"
        },
        MaxDistance:"2.0",
        Rates:{
            treasure:"1"
        }
    },
    Selectable:{
        Overlay:{
            AlwaysVisible:(void 0),
            Texture:{
                MainTexture:"star/256x256.png",
                MainTextureMask:"star/256x256_mask.png"
            }
        }
    },
    Sound:{
        SoundGroups:{
            attacked:"interface/alarm/alarm_attackplayer.xml",
            death:"actor/human/death/death.xml"
        }
    },
    StatusBars:{
        BarHeight:"0.333",
        BarWidth:"2.0",
        HeightOffset:"5.0"
    },
    TrainingRestrictions:{
        Category:"Hero"
    },
    UnitAI:{
        AlertReactiveLevel:"2",
        CanGuard:"true",
        CanPatrol:"true",
        DefaultStance:"aggressive",
        FleeDistance:"12.0",
        FormationController:"false"
    },
    UnitMotion:{
        FormationController:"false",
        PassabilityClass:"default",
        Run:{
            DecayTime:"0.2",
            Range:"200.0",
            RangeMin:"0.0",
            RegenTime:"0.1",
            Speed:"12.0"
        },
        WalkSpeed:"9"
    },
    Visibility:{
        AlwaysVisible:"false",
        Corpse:"false",
        Preview:"false",
        RetainInFog:"false"
    },
    Vision:{
        Range:"30"
    },
    VisionSharing:{
        Bribable:"false"
    },
    VisualActor:{
        Actor:"units/mauryans/hero_chanakya.xml",
        SilhouetteDisplay:"true",
        SilhouetteOccluder:"false",
        VisibleInAtlasOnly:"false"
    }
}

The diff is

@@ -1,5 +1,5 @@
 {
-    '@parent':"template_unit",
+    '@parent':"template_unit_hero_healer",
     AIProxy:(void 0),
     Armour:{
         Crush:"4.0",
@@ -60,7 +60,7 @@
         Civ:"maur",
         Classes:{
             '@datatype':"tokens",
-            _string:"Unit ConquestCritical Human Organic"
+            _string:"Unit ConquestCritical Organic Human"
         },
         Formations:{
             '@datatype':"tokens",
@@ -72,9 +72,16 @@
         SpecificName:"Acharya Ch\u0101\u1E47akya",
         VisibleClasses:{
             '@datatype':"tokens",
-            _string:"Healer Hero Support"
+            _string:"Hero Healer Support"
         }
     },
+    Loot:{
+        food:"10",
+        metal:"25",
+        stone:"0",
+        wood:"0",
+        xp:"400"
+    },
     Looter:(void 0),
     Minimap:{
         Type:"hero"
@@ -122,7 +129,8 @@
     },
     Sound:{
         SoundGroups:{
-            attacked:"interface/alarm/alarm_attackplayer.xml"
+            attacked:"interface/alarm/alarm_attackplayer.xml",
+            death:"actor/human/death/death.xml"
         }
     },
     StatusBars:{

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

fatherbushido created this revision.Sep 16 2017, 5:10 PM
fatherbushido edited the test plan for this revision. (Show Details)

remove remanent files

Regicide or AI doesn't seem affected by that.

binaries/data/mods/public/simulation/templates/template_unit_hero.xml
57 ↗(On Diff #3682)

I checked, the (specific) attack entry is in all child

refs D747, D809
refs #4678, #4233 (for common issues)

This revision was automatically updated to reflect the committed changes.
Vulcan added a subscriber: Vulcan.Sep 16 2017, 5:59 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2035/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/globalscripts/Templates.js
|  61| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/globalscripts/Templates.js
|  60| »   »   if·(sublist.every(c·=>·(c[0]·==·"!"·&&·classes.indexOf(c.substr(1))·==·-1)
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/globalscripts/Templates.js
| 146| »   »   »   let·getAttackStat·=·function(stat)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jenkins-master:8080/job/phabricator_lint/525/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2036/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jenkins-master:8080/job/phabricator_lint/526/ for more details.