Make RustRaptor the repository root and track its playable bundle

This commit is contained in:
raptorreplica committed 2026-10-11 16:33:37 +11:00
1 parent 4b1edefeec
commit 8f459796b1
9860 files changed
+21084 -61019

No files matched your search

@@ -0,0 +1,59 @@
fn on_mission_start(event,state,random) {
let commands=[
#{op:"objective",key:"iron_coast_mission_2:phase",value:1},
#{op:"objective",key:"iron_coast_mission_2:relays_disabled",value:0},
#{op:"objective",key:"iron_coast_mission_2:complete",value:0},
#{op:"objective",key:"iron_coast_boss_2:defeated",value:0},
#{op:"play_sound",sound:"iron_coast_mission_2:approach"}
];
let trial_loaned=false;
let slots=event.player.inventory.len()+event.player.super_shield_reserves.len();
if !event.player.inventory.contains("pulse_cannon:equipment") && slots<20 {
commands.push(#{op:"give_item",item:"pulse_cannon:equipment",count:1});
trial_loaned=true;
}
#{commands:commands,state:#{network_alarm:false,boss_alarm:false,network_down:false,complete:false,trial_loaned:trial_loaned}}
}
fn on_tick(event,state,random) {
let commands=[];
if event.tick>=170 && !state.network_alarm {
state.network_alarm=true;
commands.push(#{op:"objective",key:"iron_coast_mission_2:phase",value:2});
commands.push(#{op:"play_sound",sound:"iron_coast_mission_2:network_alarm"});
}
let relays=if event.objectives.contains("iron_coast_mission_2:relays_disabled") {
event.objectives["iron_coast_mission_2:relays_disabled"]
} else {0};
if relays>=3 && !state.network_down {
state.network_down=true;
commands.push(#{op:"objective",key:"iron_coast_mission_2:network_down",value:1});
commands.push(#{op:"play_sound",sound:"iron_coast_mission_2:network_down"});
}
if event.tick>=860 && !state.boss_alarm {
state.boss_alarm=true;
commands.push(#{op:"objective",key:"iron_coast_mission_2:phase",value:3});
commands.push(#{op:"play_sound",sound:"iron_coast_mission_2:boss_alarm"});
}
let boss=if event.objectives.contains("iron_coast_boss_2:defeated") {
event.objectives["iron_coast_boss_2:defeated"]
} else {0};
if relays>=3 && boss>=1 && !state.complete {
state.complete=true;
commands.push(#{op:"objective",key:"iron_coast_mission_2:phase",value:4});
commands.push(#{op:"objective",key:"iron_coast_mission_2:complete",value:1});
commands.push(#{op:"credits",amount:7500});
commands.push(#{op:"play_sound",sound:"iron_coast_mission_2:victory"});
commands.push(#{op:"complete"});
}
#{commands:commands,state:state}
}
fn on_mission_end(event,state,random) {
let commands=[#{op:"objective",key:"iron_coast_mission_2:debrief",value:if event.success {1} else {0}}];
if state.contains("trial_loaned") && state.trial_loaned
&& event.player.inventory.contains("pulse_cannon:equipment")
&& event.player.inventory["pulse_cannon:equipment"]>0 {
commands.push(#{op:"consume_item",item:"pulse_cannon:equipment",count:1});
}
state.trial_loaned=false;
#{commands:commands,state:state}
}
@@ -0,0 +1,44 @@
// Required relay targets settle into the firing corridor and never scroll away.
fn alive(event) {
for unit in event.entities {
if unit.entity == event.entity && unit.health > 0 {return true;}
}
false
}
fn on_spawn(event,state,random) {
if !state.contains("live") {state.live=#{};}
// Register even a lethal-on-spawn life so its queued death counts once.
state.live[event.entity.to_string()]=true;
if !alive(event) {return #{commands:[],state:state};}
#{commands:[#{op:"velocity",entity:event.entity,vx:0,vy:1}],state:state}
}
fn on_tick(event,state,random) {
if event.health<=0 || !alive(event) {return #{commands:[],state:state};}
// Vary the station depth by its original horizontal lane.
let anchor=if event.x<120 {28} else if event.x>160 {48} else {68};
if event.y>=anchor {
return #{commands:[
#{op:"move",entity:event.entity,x:event.x,y:anchor},
#{op:"velocity",entity:event.entity,vx:0,vy:0}
],state:state};
}
#{commands:[],state:state}
}
fn on_fire(event,state,random) {
#{commands:[#{op:"play_sound",sound:"iron_coast_turret:shot"}],state:state}
}
fn on_death(event,state,random) {
let key=event.entity.to_string();
if alive(event) || !state.contains("live") || !state.live.contains(key) {
return #{commands:[],state:state};
}
state.live.remove(key);
let count=if event.objectives.contains("iron_coast_mission_2:relays_disabled") {
event.objectives["iron_coast_mission_2:relays_disabled"]+1
} else {1};
#{commands:[
#{op:"objective",key:"iron_coast_mission_2:relays_disabled",value:count},
#{op:"shield",amount:12},
#{op:"play_sound",sound:"iron_coast_mission_2:relay_offline"}
],state:state}
}