Skip to content

Commit

Permalink
first attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
ethangarsia517 committed Dec 3, 2023
1 parent b836daf commit 94108fe
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 17 deletions.
5 changes: 5 additions & 0 deletions src/kirby/acmd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod specials;

pub fn install(agent: &mut smashline::Agent) {
specials::install(agent);
}
26 changes: 26 additions & 0 deletions src/kirby/acmd/specials.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use {
smash::{
lua2cpp::*,
phx::*,
app::{sv_animcmd::*, lua_bind::*},
lib::lua_const::*
},
smash_script::*
};

use crate::vars::FIGHTER_KIRBY_GENERATE_ARTICLE_EXPLOSIVEFLAME;
use crate::vars::FIGHTER_KIRBY_GENERATE_ARTICLE_REFLECTIONBOARD;
use crate::vars::FIGHTER_KIRBY_GENERATE_ARTICLE_FIREBALL;


unsafe extern "C" fn kirby_attacks3(agent: &mut L2CAgentBase) {
macros::FT_MOTION_RATE(agent, 1.2);
frame(agent.lua_state_agent, 16.0);
if macros::is_excute(agent) {
ArticleModule::generate_article(agent.module_accessor, FIGHTER_KIRBY_GENERATE_ARTICLE_FIREBALL, false, -1);
}
}

pub fn install(agent: &mut smashline::Agent) {
agent.game_acmd("game_attacks3", kirby_attacks3);
}
8 changes: 8 additions & 0 deletions src/kirby/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
use smashline;

mod acmd;

pub fn install() {

let agent = &mut smashline::Agent::new("kirby");
acmd::install(agent);
agent.install();

smashline::clone_weapon("palutena", "explosiveflame", "kirby", "explosiveflame",true);
smashline::clone_weapon("mario", "fireball", "kirby", "fireball",true);
smashline::clone_weapon("palutena", "explosiveflame_reserve", "kirby", "explosiveflame_reserve",true);
smashline::clone_weapon("palutena", "reflectionboard", "kirby", "reflectionboard",true);
}
11 changes: 8 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
unused_macros
)]

mod mario;
mod custom;
use smashline::*;

mod kirby;
mod palutena;
pub mod vars;

#[skyline::main(name = "smashline_test")]
pub fn main() {
mario::install();
kirby::install();
palutena::install();

}
19 changes: 5 additions & 14 deletions src/palutena/acmd/specials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@ use {
smash_script::*
};

unsafe extern "C" fn game_specialn(agent: &mut L2CAgentBase) {
if WorkModule::get_int(boma, *FIGHTER_INSTANCE_WORK_ID_INT_KIND) == *FIGHTER_KIND_KIRBY {
macros::FT_MOTION_RATE(agent, 1.2);
frame(agent.lua_state_agent, 22.0);
if macros::is_excute(agent) {
ArticleModule::generate_article(agent.module_accessor, *FIGHTER_KIRBY_GENERATE_ARTICLE_EXPLOSIVEFLAME, false, -1);
}
}
frame(agent.lua_state_agent, 7.0);
if macros::is_excute(agent) {
macros::SEARCH(agent, 0, 0, Hash40::new("bust"), 120.0, 0.0, 0.0, 0.0, *COLLISION_KIND_MASK_HIT, *HIT_STATUS_MASK_NORMAL, 1, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_FIEB, *COLLISION_PART_MASK_BODY_HEAD, false);
}
frame(agent.lua_state_agent, 15.0);

unsafe extern "C" fn palutena_specialn(agent: &mut L2CAgentBase) {
macros::FT_MOTION_RATE(agent, 1.2);
frame(agent.lua_state_agent, 22.0);
if macros::is_excute(agent) {
search!(agent, *MA_MSC_CMD_SEARCH_SEARCH_SCH_CLR_ALL);
ArticleModule::generate_article(agent.module_accessor, *FIGHTER_PALUTENA_GENERATE_ARTICLE_EXPLOSIVEFLAME, false, -1);
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/vars.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub const FIGHTER_KIRBY_GENERATE_ARTICLE_EXPLOSIVEFLAME: i32 = 40;
pub const FIGHTER_KIRBY_GENERATE_ARTICLE_REFLECTIONBOARD: i32 = 41;
pub const FIGHTER_KIRBY_GENERATE_ARTICLE_FIREBALL: i32 = 42;

0 comments on commit 94108fe

Please sign in to comment.