狗屎Minimax坏我代码
This commit is contained in:
@@ -52,7 +52,7 @@ namespace Cielonos.MainGame
|
||||
return Initialize<T>(creator, null, targetFractions);
|
||||
}
|
||||
|
||||
public T Initialize<T>(CharacterBase creator, ItemBase itemSource, params Fraction[] targetFractions) where T : AttackAreaBase
|
||||
public virtual T Initialize<T>(CharacterBase creator, ItemBase itemSource, params Fraction[] targetFractions) where T : AttackAreaBase
|
||||
{
|
||||
this.isEnabling = true;
|
||||
this.creator = creator;
|
||||
@@ -390,6 +390,13 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
//最终伤害结算
|
||||
target.TakeDamage(ref attackResult);
|
||||
|
||||
Attack.AttackType attackType = attackResult.attackValue.attackType;
|
||||
bool isCritical = attackResult.attackValue.isCritical;
|
||||
MainGameBaseCollection.Instance.DamageNumber(attackType, isCritical)
|
||||
.Spawn(attackResult.hitPosition, attackResult.finalDamage, transform)
|
||||
.SetSpamGroup(attackResult.spamGroupID);
|
||||
|
||||
creator.eventSm.onFinishAttack.Invoke(this, target, attackResult);
|
||||
if (attackResult.finalDamage > 0)
|
||||
{
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Cielonos.MainGame
|
||||
Kinetics = 2,
|
||||
Explosion = 3,
|
||||
Magic = 4,
|
||||
Elemental = 5,
|
||||
Pure = 6
|
||||
Pure = 5,
|
||||
Blank = 6, // 代表不具有特定攻击类型的伤害,例如持续伤害、反伤等
|
||||
}
|
||||
|
||||
public static string AttackTypeToString(this AttackType attackType)
|
||||
@@ -28,8 +28,8 @@ namespace Cielonos.MainGame
|
||||
AttackType.Kinetics => "Kinetics",
|
||||
AttackType.Explosion => "Explosion",
|
||||
AttackType.Magic => "Magic",
|
||||
AttackType.Elemental => "Elemental",
|
||||
AttackType.Pure => "Pure",
|
||||
AttackType.Blank => "Blank",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(attackType), attackType, null)
|
||||
};
|
||||
}
|
||||
@@ -88,12 +88,14 @@ namespace Cielonos.MainGame
|
||||
public Attack.AttackType attackType;
|
||||
public BreakthroughType breakthroughType;
|
||||
public DisruptionType disruptionType;
|
||||
public List<string> tags;
|
||||
|
||||
public float damageMultiplier = 1f;
|
||||
public float additionalFlatDamage = 0f;
|
||||
|
||||
public AttackValue(CharacterBase attacker, bool isCritical, float damage, Attack.AttackType attackType,
|
||||
DisruptionType disruptionType = DisruptionType.None, BreakthroughType breakthroughType = BreakthroughType.None)
|
||||
DisruptionType disruptionType = DisruptionType.None, BreakthroughType breakthroughType = BreakthroughType.None,
|
||||
List<string> tags = null)
|
||||
{
|
||||
this.attacker = attacker;
|
||||
this.isCritical = isCritical;
|
||||
@@ -101,11 +103,12 @@ namespace Cielonos.MainGame
|
||||
this.attackType = attackType;
|
||||
this.disruptionType = disruptionType;
|
||||
this.breakthroughType = breakthroughType;
|
||||
this.tags = tags != null ? new List<string>(tags) : new List<string>();
|
||||
}
|
||||
|
||||
public AttackValue Clone()
|
||||
{
|
||||
AttackValue cloned = new AttackValue(attacker, isCritical, damage, attackType, disruptionType, breakthroughType);
|
||||
AttackValue cloned = new AttackValue(attacker, isCritical, damage, attackType, disruptionType, breakthroughType, tags);
|
||||
cloned.damageMultiplier = this.damageMultiplier;
|
||||
cloned.additionalFlatDamage = this.additionalFlatDamage;
|
||||
return cloned;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Cielonos.MainGame.Characters;
|
||||
using Cielonos.MainGame.Characters.Inventory;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -6,6 +7,13 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
public partial class NormalArea : AttackAreaBase
|
||||
{
|
||||
public override T Initialize<T>(CharacterBase creator, ItemBase itemSource, params Fraction[] targetFractions)
|
||||
{
|
||||
T area = base.Initialize<T>(creator, itemSource, targetFractions);
|
||||
topParent.transform.localScale *= creator.attributeSm[CharacterAttribute.AttackRangeMultiplier];
|
||||
return area;
|
||||
}
|
||||
|
||||
private void OnTriggerStay(Collider other)
|
||||
{
|
||||
HitCharacter(other, default);
|
||||
|
||||
@@ -148,12 +148,18 @@ namespace Cielonos.MainGame
|
||||
firstDodgeSource = characterDodgeSm.dodgeSources.Find(source => source.isDuringPerfectDodge);
|
||||
firstDodgeSource.PerfectDodge();
|
||||
perfectDodgeAction?.Invoke(dodger);
|
||||
|
||||
// 触发完美闪避成功事件
|
||||
dodger.eventSm.onPerfectDodgeSuccess.Invoke(owner, firstDodgeSource);
|
||||
}
|
||||
else
|
||||
{
|
||||
firstDodgeSource = characterDodgeSm.dodgeSources[0];
|
||||
firstDodgeSource.NormalDodge();
|
||||
normalDodgeAction?.Invoke(dodger);
|
||||
|
||||
// 触发普通闪避成功事件
|
||||
dodger.eventSm.onNormalDodgeSuccess.Invoke(owner, firstDodgeSource);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user