You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			64 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
			
		
		
	
	
			64 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
| using Articy.Touhou;
 | |
| using Articy.Touhou.Features;
 | |
| using Articy.Unity;
 | |
| 
 | |
| namespace Game
 | |
| {
 | |
|     public enum ESkillTriggerTimingType
 | |
|     {
 | |
|         Hit,//技能命中
 | |
|         Recover,//触发点 收刀
 | |
|     }
 | |
|     public partial class UtilSkillTrigger
 | |
|     {
 | |
|         public static void Trigger(int owner, int target, string skillId, ESkillTriggerTimingType timingType)
 | |
|         {
 | |
|             if (string.IsNullOrEmpty(skillId))
 | |
|             {
 | |
|                 return;
 | |
|             }
 | |
|             //TODO 暂时只有player拥有技能触发器
 | |
|             var skillCfg = Util.GetSkillMasterConfigData(skillId);
 | |
|             if (skillCfg == null)
 | |
|             {
 | |
|                 return;
 | |
|             }
 | |
|             var featureSkillCombo = skillCfg.GetFeatureSkillCombo();
 | |
|             var entity = Util.GetEntity(owner);
 | |
|             foreach (var item in featureSkillCombo.SkillTrigger)
 | |
|             {
 | |
|                 if (item is IObjectWithFeatureSkillTrigger)
 | |
|                 {
 | |
|                     var skillTrigger = (item as IObjectWithFeatureSkillTrigger).GetFeatureSkillTrigger();
 | |
|                     if ((ESkillTriggerTimingType)skillTrigger.TriggerTiming != timingType)
 | |
|                     {
 | |
|                         continue;
 | |
|                     }
 | |
|                     if (skillTrigger.Bless != null)
 | |
|                     {
 | |
|                         if (!Util.HasBless(entity, skillTrigger.Bless.TechnicalName))
 | |
|                         {
 | |
|                             continue;
 | |
|                         }
 | |
|                     }
 | |
|                     TriggerSub(owner, target, item);
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|         private static void TriggerSub(int owner, int target, ArticyObject obj)
 | |
|         {
 | |
|             if (obj is IObjectWithFeatureSkillTriggerKnife)
 | |
|             {
 | |
|                 var knifeFeature = (obj as IObjectWithFeatureSkillTriggerKnife).GetFeatureSkillTriggerKnife();
 | |
|                 TriggerKnife(owner, target, knifeFeature);
 | |
|             }
 | |
| 
 | |
|         }
 | |
|         private static void TriggerKnife(int owner, int target, SkillTriggerKnifeFeature knifeFeature)
 | |
|         {
 | |
|             //TODO 暂时只有player
 | |
|             var masterSoul = Util.GetMasterSoul();
 | |
|             Util.AddMasterSoulShootTarget(masterSoul, target, knifeFeature.Count);
 | |
|         }
 | |
|     }
 | |
| } |