Changeset 297


Ignore:
Timestamp:
Mar 29, 2019, 2:11:34 PM (6 years ago)
Author:
chronos
Message:
  • Added: Unit bonuses configurable for buildings.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Languages/xtactics.cs.po

    r296 r297  
    956956msgid "Repeat count"
    957957msgstr "Opakovaný počet"
     958
     959#: ubuilding.sbonusattack
     960msgid "Unit attack bonus"
     961msgstr "Útočný bonus jednotky"
     962
     963#: ubuilding.sbonusdefense
     964msgid "Unit defense bonus"
     965msgstr "Obranný bonus jednotky"
     966
     967#: ubuilding.sbonusgrow
     968msgid "Unit grow bonus"
     969msgstr "Růstový bonus jednotky"
     970
     971#: ubuilding.sbonusviewrange
     972msgid "Unit view range bonus"
     973msgstr "Dohledový bonus jednotky"
    958974
    959975#: ubuilding.sbuildingkind
  • trunk/Languages/xtactics.po

    r296 r297  
    940940#: tformunitmoves.listview1.columns[3].caption
    941941msgid "Repeat count"
     942msgstr ""
     943
     944#: ubuilding.sbonusattack
     945msgid "Unit attack bonus"
     946msgstr ""
     947
     948#: ubuilding.sbonusdefense
     949msgid "Unit defense bonus"
     950msgstr ""
     951
     952#: ubuilding.sbonusgrow
     953msgid "Unit grow bonus"
     954msgstr ""
     955
     956#: ubuilding.sbonusviewrange
     957msgid "Unit view range bonus"
    942958msgstr ""
    943959
  • trunk/Systems/HexWars.xts

    r294 r297  
    2222      <Name>City</Name>
    2323      <Cost>0</Cost>
    24       <SpecialType>9515521</SpecialType>
     24      <SpecialType>1</SpecialType>
     25      <BonusAttack>0</BonusAttack>
     26      <BonusDefense>0</BonusDefense>
     27      <BonusViewRange>0</BonusViewRange>
     28      <BonusGrow>0</BonusGrow>
     29    </BuildingKind>
     30    <BuildingKind>
     31      <Id>0</Id>
     32      <Name>Defense</Name>
     33      <Cost>0</Cost>
     34      <SpecialType>0</SpecialType>
     35      <BonusAttack>0</BonusAttack>
     36      <BonusDefense>25</BonusDefense>
     37      <BonusViewRange>0</BonusViewRange>
     38      <BonusGrow>0</BonusGrow>
     39    </BuildingKind>
     40    <BuildingKind>
     41      <Id>0</Id>
     42      <Name>Attack</Name>
     43      <Cost>0</Cost>
     44      <SpecialType>0</SpecialType>
     45      <BonusAttack>25</BonusAttack>
     46      <BonusDefense>0</BonusDefense>
     47      <BonusViewRange>0</BonusViewRange>
     48      <BonusGrow>0</BonusGrow>
     49    </BuildingKind>
     50    <BuildingKind>
     51      <Id>0</Id>
     52      <Name>Spyglass</Name>
     53      <Cost>0</Cost>
     54      <SpecialType>0</SpecialType>
     55      <BonusAttack>0</BonusAttack>
     56      <BonusDefense>0</BonusDefense>
     57      <BonusViewRange>100</BonusViewRange>
     58      <BonusGrow>0</BonusGrow>
     59    </BuildingKind>
     60    <BuildingKind>
     61      <Id>0</Id>
     62      <Name>Bronze</Name>
     63      <Cost>0</Cost>
     64      <SpecialType>0</SpecialType>
     65      <BonusAttack>0</BonusAttack>
     66      <BonusDefense>0</BonusDefense>
     67      <BonusViewRange>0</BonusViewRange>
     68      <BonusGrow>50</BonusGrow>
     69    </BuildingKind>
     70    <BuildingKind>
     71      <Id>0</Id>
     72      <Name>Silver</Name>
     73      <Cost>0</Cost>
     74      <SpecialType>0</SpecialType>
     75      <BonusAttack>0</BonusAttack>
     76      <BonusDefense>0</BonusDefense>
     77      <BonusViewRange>0</BonusViewRange>
     78      <BonusGrow>100</BonusGrow>
     79    </BuildingKind>
     80    <BuildingKind>
     81      <Id>0</Id>
     82      <Name>Gold</Name>
     83      <Cost>0</Cost>
     84      <SpecialType>0</SpecialType>
     85      <BonusAttack>0</BonusAttack>
     86      <BonusDefense>0</BonusDefense>
     87      <BonusViewRange>0</BonusViewRange>
     88      <BonusGrow>150</BonusGrow>
    2589    </BuildingKind>
    2690  </BuildingKinds>
  • trunk/UBuilding.pas

    r296 r297  
    1616    Cost: Integer;
    1717    SpecialType: TBuildingSpecialType;
     18    BonusAttack: Integer;
     19    BonusDefense: Integer;
     20    BonusViewRange: Integer;
     21    BonusGrow: Integer;
    1822    class function GetFields: TItemFields; override;
    1923    procedure GetValue(Index: Integer; out Value); override;
     
    5458  SNone = 'None';
    5559  SCity = 'City';
     60  SBonusAttack = 'Unit attack bonus';
     61  SBonusDefense = 'Unit defense bonus';
     62  SBonusViewRange = 'Unit view range bonus';
     63  SBonusGrow = 'Unit grow bonus';
    5664
    5765
     
    93101  Field.EnumStates.Add(SNone);
    94102  Field.EnumStates.Add(SCity);
     103  Result.AddField(4, 'BonusAttack', SBonusAttack, dtInteger);
     104  Result.AddField(5, 'BonusDefense', SBonusDefense, dtInteger);
     105  Result.AddField(6, 'BonusViewRange', SBonusViewRange, dtInteger);
     106  Result.AddField(7, 'BonusGrow', SBonusGrow, dtInteger);
    95107end;
    96108
     
    100112  else if Index = 2 then Integer(Value) := Cost
    101113  else if Index = 3 then TBuildingSpecialType(Value) := SpecialType
     114  else if Index = 4 then Integer(Value) := BonusAttack
     115  else if Index = 5 then Integer(Value) := BonusDefense
     116  else if Index = 6 then Integer(Value) := BonusViewRange
     117  else if Index = 7 then Integer(Value) := BonusGrow
    102118  else inherited;
    103119end;
     
    108124  else if Index = 2 then Cost := Integer(Value)
    109125  else if Index = 3 then SpecialType := TBuildingSpecialType(Value)
     126  else if Index = 4 then BonusAttack := Integer(Value)
     127  else if Index = 5 then BonusDefense := Integer(Value)
     128  else if Index = 6 then BonusViewRange := Integer(Value)
     129  else if Index = 7 then BonusGrow := Integer(Value)
    110130  else inherited;
    111131end;
  • trunk/UPlayer.pas

    r294 r297  
    13331333          if Addition = 0 then Addition := 1;
    13341334        end;
     1335        if Assigned(Building) and (Building.Kind.BonusGrow > 0) then
     1336          OneUnit.Power := OneUnit.Power + Trunc(OneUnit.Power * Building.Kind.BonusGrow / 100);
    13351337        OneUnit.Power := Min(OneUnit.Power + Addition, MaxPower);
    13361338      end else
Note: See TracChangeset for help on using the changeset viewer.