Merge branch 'main' of http://10.27.17.121:3000/kawagiri/TH1
This commit is contained in:
commit
5f601fef7f
@ -199,6 +199,11 @@ namespace TH1_Logic.MatchConfig
|
||||
public virtual void OnAddHero(MapData mapData, PlayerData self, UnitFullType fullType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void OnUpgradeHero(MapData mapData, PlayerData self, UnitFullType fullType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void OnWonderBuild(MapData map, PlayerData player, WonderTypeEnum wonderType)
|
||||
@ -1090,10 +1095,12 @@ namespace TH1_Logic.MatchConfig
|
||||
|
||||
public override MomentSubType GetMomentSubType() => MomentSubType.BattleHasTwoHero;
|
||||
|
||||
public override void OnAddHero(MapData mapData, PlayerData self, UnitFullType fullType)
|
||||
public override void OnUpgradeHero(MapData mapData, PlayerData self, UnitFullType fullType)
|
||||
{
|
||||
if (self.PlayerHeroData.HeroCount != 2) return;
|
||||
if (IsExecute) return;
|
||||
if (fullType.UnitLevel != 2) return;
|
||||
Execute(self);
|
||||
IsExecute = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1108,10 +1115,12 @@ namespace TH1_Logic.MatchConfig
|
||||
|
||||
public override MomentSubType GetMomentSubType() => MomentSubType.BattleHasThreeHero;
|
||||
|
||||
public override void OnAddHero(MapData mapData, PlayerData self, UnitFullType fullType)
|
||||
public override void OnUpgradeHero(MapData mapData, PlayerData self, UnitFullType fullType)
|
||||
{
|
||||
if (self.PlayerHeroData.HeroCount != 3) return;
|
||||
if (IsExecute) return;
|
||||
if (fullType.UnitLevel != 3) return;
|
||||
Execute(self);
|
||||
IsExecute = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1322,6 +1322,8 @@ namespace Logic
|
||||
|
||||
public bool HeroUpgrade(MapData map,UnitData unit)
|
||||
{
|
||||
var player = unit.Player(map);
|
||||
if (player == null) return false;
|
||||
var type = unit.UnitFullType;
|
||||
if (type.UnitType != UnitType.Giant) return false;
|
||||
if (type.GiantType == GiantType.None) return false;
|
||||
@ -1329,7 +1331,9 @@ namespace Logic
|
||||
var targetType = new UnitFullType()
|
||||
{ UnitType = unit.UnitType, GiantType = unit.GiantType, UnitLevel = unit.UnitLevel + 1 };
|
||||
UnitTypeTransform(map,unit,targetType);
|
||||
unit.Player(map)?.PlayerHeroData.UpdateHeroMaxCount(targetType.UnitLevel);
|
||||
player.PlayerHeroData.UpdateHeroMaxCount(targetType.UnitLevel);
|
||||
// moment
|
||||
foreach (var item in player.MomentData.Items) item.OnUpgradeHero(map, player, targetType);
|
||||
return unit.Player(map)?.PlayerHeroData.UpdateHero(map,unit.Player(map),unit.UnitFullType) ?? false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user