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.
		
		
		
		
		
			
		
			
	
	
		
			120 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			C#
		
	
		
		
			
		
	
	
			120 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			C#
		
	
| 
											2 years ago
										 | using Bolt; | ||
|  | 
 | ||
|  | namespace Game | ||
|  | { | ||
|  |     [UnitTitle("设置模块类型")] | ||
|  |     [UnitSubtitle("NodeSetModuleType")] | ||
|  |     [UnitCategory("Game-AIDirector")] | ||
|  |     public class NodeSetModuleType : NodeDefault | ||
|  |     { | ||
|  |         public ValueInput entity; | ||
|  |         public ValueInput type; | ||
|  |         protected override void Def() | ||
|  |         { | ||
|  |             entity = ValueInput<int>("entity"); | ||
|  |             type = ValueInput<EAIModuleType>("type", EAIModuleType.Spectator); | ||
|  |         } | ||
|  |         protected override void Run(Flow flow) | ||
|  |         { | ||
|  |             var e = flow.GetValue<int>(entity); | ||
|  |             var t = flow.GetValue<EAIModuleType>(type); | ||
|  |             Util.SetAIModuleType(e, t); | ||
|  |         } | ||
|  |     } | ||
|  |     [UnitTitle("获取模块类型")] | ||
|  |     [UnitSubtitle("NodeGetModuleType")] | ||
|  |     [UnitCategory("Game-AIDirector")] | ||
|  |     public class NodeGetModuleType : NodeDefault | ||
|  |     { | ||
|  |         public ValueInput entity; | ||
|  |         public ValueOutput type; | ||
|  |         protected override void Def() | ||
|  |         { | ||
|  |             entity = ValueInput<int>("entity"); | ||
|  |             type = ValueOutput<EAIModuleType>("type"); | ||
|  |         } | ||
|  |         protected override void Run(Flow flow) | ||
|  |         { | ||
|  |             var e = flow.GetValue<int>(entity); | ||
|  |             var t = Util.GetAIModuleType(e); | ||
|  |             flow.SetValue(type, t); | ||
|  |         } | ||
|  |     } | ||
|  |     [UnitTitle("获取模块数量")] | ||
|  |     [UnitSubtitle("NodeGetModuleNum")] | ||
|  |     [UnitCategory("Game-AIDirector")] | ||
|  |     public class NodeGetModuleNum : NodeDefault | ||
|  |     { | ||
|  |         public ValueInput type; | ||
|  |         public ValueOutput num; | ||
|  |         protected override void Def() | ||
|  |         { | ||
|  |             type = ValueInput<EAIModuleType>("type", EAIModuleType.Spectator); | ||
|  |             num = ValueOutput<int>("num"); | ||
|  |         } | ||
|  |         protected override void Run(Flow flow) | ||
|  |         { | ||
|  |             var t = flow.GetValue<EAIModuleType>(type); | ||
|  |             var n = Util.GetModuleNum(t); | ||
|  |             flow.SetValue(num, n); | ||
|  |         } | ||
|  |     } | ||
|  |     [UnitTitle("设置攻击权限")] | ||
|  |     [UnitSubtitle("NodeSetAttackPermit")] | ||
|  |     [UnitCategory("Game-AIDirector")] | ||
|  |     public class NodeSetAttackPermit : NodeDefault | ||
|  |     { | ||
|  |         public ValueInput entity; | ||
|  |         public ValueInput value; | ||
|  |         protected override void Def() | ||
|  |         { | ||
|  |             entity = ValueInput<int>("entity"); | ||
|  |             value = ValueInput<bool>("value", false); | ||
|  |         } | ||
|  |         protected override void Run(Flow flow) | ||
|  |         { | ||
|  |             var e = flow.GetValue<int>(entity); | ||
|  |             var v = flow.GetValue<bool>(value); | ||
|  |             Util.SetAttackPermit(e, v); | ||
|  |         } | ||
|  |     } | ||
|  |     [UnitTitle("获取攻击权限")] | ||
|  |     [UnitSubtitle("NodeGetAttackPermit")] | ||
|  |     [UnitCategory("Game-AIDirector")] | ||
|  |     public class NodeGetAttackPermit : NodeDefault | ||
|  |     { | ||
|  |         public ValueInput entity; | ||
|  |         public ValueOutput ok; | ||
|  |         protected override void Def() | ||
|  |         { | ||
|  |             entity = ValueInput<int>("entity"); | ||
|  |             ok = ValueOutput<bool>("ok"); | ||
|  |         } | ||
|  |         protected override void Run(Flow flow) | ||
|  |         { | ||
|  |             var e = flow.GetValue<int>(entity); | ||
|  |             var o = Util.GetAttackPermit(e); | ||
|  |             flow.SetValue(ok, o); | ||
|  |         } | ||
|  |     } | ||
|  |     [UnitTitle("饥饿值是否已满")] | ||
|  |     [UnitSubtitle("NodeGetHungryFull")] | ||
|  |     [UnitCategory("Game-AIDirector")] | ||
|  |     public class NodeGetHungryFull : NodeDefault | ||
|  |     { | ||
|  |         public ValueInput entity; | ||
|  |         public ValueOutput ok; | ||
|  |         protected override void Def() | ||
|  |         { | ||
|  |             entity = ValueInput<int>("entity"); | ||
|  |             ok = ValueOutput<bool>("ok"); | ||
|  |         } | ||
|  |         protected override void Run(Flow flow) | ||
|  |         { | ||
|  |             var e = flow.GetValue<int>(entity); | ||
|  |             var o = Util.GetHungryFull(e); | ||
|  |             flow.SetValue(ok, o); | ||
|  |         } | ||
|  |     } | ||
|  | 
 | ||
|  | } |