(Units) Chameleon needs a new skill.

Issue #79 new
NDark Teng repo owner created an issue

Try to design a new skill for Chameleon.

File

BuffType.cs

SkillSetting.cs SkillSetting.txt

UnitSetting.cs UnitSetting.txt

UnitSetting::SkillCode

模擬器.

Skill Initialize

InitializeBuffs()

var attackSkillSetting = VTacticStaticData.FindSkillSetting(attackUnitSetting.SkillCode , true);

ApplySkillBuffs( attackSkillSetting , false , false );

var buffs = skillSetting.GetBuffCodes();

var attackBuffSetting = VTacticStaticData.FindBuffSetting(iBuffKey);

this.ApplyBuff(attackBuffSetting , checkBlessing , ignoreSpread , overrideValue0 , overrideCoolDownSec );

AI

CreasureAIAttackToFarm::WalkToCurrentTarget()

if ( true == CheckAbleToUseSkill( ref activeSkill , resultTargets ) )

activeSkill = m_Bundle.FindActiveSkill() ;

FindTargetsFor( (this.aiRole == UnitRole.Citizen) , buffSetting , resultTargets );

Skill

TryUseSkill(activeSkill,resultTargets);

public void UnitUseSkill( UnitBundle unit , BuffType activeSkill , List<UnitBundle> resultTargets)

TryApplyBuffOnTargets(buffData.Setting, resultTargets);

Attack

s_System.TryCheckCreasureAttack(m_Bundle, citizen);

float ret = TryCreasureAttackCitizen( creasure , sourceCitizen );

CheckAttackSkill( creasure , citizenBundle
, out damageBuff , out damageMultiplier
, out damageRatio
, out damageSuckRatio );

TryApplyBuffOnTargets(attackBuffSetting, receiver);

Buff

BuffSetting.cs BuffSetting.txt

  1. Key
  2. DurationSec 持續時間 -1代表常駐不會消失.
  3. Negative 負面效果(預設為0正面Buff)
  4. Target (初始對象.0敵軍,
    1.友軍非自己為對象但最後清單可以包含自己,
    2.友軍非自己為對象但最後清單不包含自己,
    3.自己為對象,
    4.自己為對象依照正負面決定清單但最終清單不包含自己)
  5. Range 技能判定距離
  6. CoolDownSec (使用後需要多久才能再次使用,非0代表是一個可使用的技能,使用後會進入冷卻時間) "
  7. ApplyBuffs 套用效果

Perform(Animation and Effect)

Animation

PerformAction 技能動畫碼 EffectCode 技能特效物件

float remainHP = s_System.TryCheckCitizenAttack(m_Bundle, m_Target);

unit.TryPerformSkill( targetPos , resultTargets[0].Obj );

m_SkillAction.TryPerformAction(targetPos , targetObject);

UnitPerformActionBase

UnitPerformAction_ShockwaveSelf

GameObject overridePrefab = s_System.GetEffectPrefabByKey( this.OverrideEffectKey ) ;// EffectShockwave

ShockwaveScaleTo scaleTo = obj.AddComponent<ShockwaveScaleTo>();

Buff Effect

AddBuffEffectToTargetsByBuffType( effectTargets , activeSkill ) ;

Example

Skill : ElephantShockwave Shockwave ShockwaveSelf EffectShockwave

Buff: Shockwave -1 1 4 2 3 Spread;Damage:4

Buff: Berserk -1 0 3 3 15 Speed;Strong;Dissolve

AtkBuff: AtkWeak3 -1 0 0 0 0 Weak;Slow;Dissolve

除錯

啟用 ClientProject\Assets\Scripts\Data\UnitBundle.cs

內的 ENABLE_DEBUG_LOG 來觀看單位運作的Log

Comments (9)

  1. NDark Teng reporter
    • edited description

    除錯

    啟用 ClientProject\Assets\Scripts\Data\UnitBundle.cs

    內的 ENABLE_DEBUG_LOG 來觀看單位運作的Log

  2. Log in to comment