Implements first few actual move effects.
This commit is contained in:
		
							
								
								
									
										35
									
								
								gen_7_scripts/src/moves/after_you.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								gen_7_scripts/src/moves/after_you.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| use pkmn_lib_interface::app_interface::{ExecutingMove, Pokemon}; | ||||
| use pkmn_lib_interface::handling::{Script, ScriptCapabilities}; | ||||
|  | ||||
| pub struct AfterYou {} | ||||
|  | ||||
| impl AfterYou { | ||||
|     pub const fn get_const_name() -> &'static str { | ||||
|         "after_you" | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl Script for AfterYou { | ||||
|     fn new() -> Self { | ||||
|         Self {} | ||||
|     } | ||||
|  | ||||
|     fn get_name() -> &'static str { | ||||
|         Self::get_const_name() | ||||
|     } | ||||
|  | ||||
|     fn get_capabilities(&self) -> &[ScriptCapabilities] { | ||||
|         &[ScriptCapabilities::OnSecondaryEffect] | ||||
|     } | ||||
|  | ||||
|     fn on_secondary_effect(&self, mv: ExecutingMove, target: Pokemon, hit: u8) { | ||||
|         if !target | ||||
|             .battle() | ||||
|             .unwrap() | ||||
|             .choice_queue() | ||||
|             .move_pokemon_choice_next(&target) | ||||
|         { | ||||
|             mv.get_hit_data(&target, hit).fail() | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user