File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ impl BattleEngine {
340340
341341 "Run" => {
342342 // TODO: implement running mechanic described earlier
343- pcb ( ) . bind_mut ( ) . battling . clear ( ) ;
343+ si ( ) . bind_mut ( ) . battling . clear ( ) ;
344344
345345 // TODO: don't change scenes, just remove the battle
346346 // stuff since it's all overlayed on top of the world
Original file line number Diff line number Diff line change @@ -14,8 +14,10 @@ use crate::common::*;
1414#[ class( base=Object ) ]
1515pub struct StatsInterface {
1616 base : Base < Object > ,
17-
1817 pub save : SaveFile ,
18+
19+ /// The enemies that are currently in battle with you
20+ pub battling : Vec < EnemyData > ,
1921}
2022
2123#[ godot_api]
@@ -65,6 +67,10 @@ impl IObject for StatsInterface {
6567 // randomize seed for godot
6668 randomize ( ) ;
6769
68- Self { base, save }
70+ Self {
71+ base,
72+ save,
73+ battling : vec ! [ ] ,
74+ }
6975 }
7076}
Original file line number Diff line number Diff line change @@ -134,10 +134,7 @@ impl World {
134134 let enemy_data = EnemyData :: from_registry ( eid. clone ( ) ) ;
135135
136136 // TODO: THIS BELONGS IN STATSINTERFACE!!!!!!!! WTF
137- pcb ( )
138- . bind_mut ( )
139- . battling
140- . push ( Rc :: new ( RefCell :: new ( enemy_data. clone ( ) ) ) ) ;
137+ si ( ) . bind_mut ( ) . battling . push ( enemy_data. clone ( ) ) ;
141138 let world = World :: singleton ( ) ;
142139
143140 let mat = PartyCB :: fx_material ( ) ;
Original file line number Diff line number Diff line change @@ -79,9 +79,6 @@ pub struct PartyCB {
7979 #[ init( val = LimiQ :: new( 2000 ) ) ]
8080 past_rotations : LimiQ < Vector2 > ,
8181
82- /// The enemies that are currently in battle with you
83- pub battling : Vec < Rc < RefCell < EnemyData > > > ,
84-
8582 pub tpbeacon_debounce : bool ,
8683 pub in_water : bool ,
8784
@@ -148,7 +145,7 @@ impl PartyCB {
148145 }
149146
150147 pub fn is_in_battle ( & self ) -> bool {
151- !self . battling . is_empty ( )
148+ !si ( ) . bind ( ) . battling . is_empty ( )
152149 }
153150
154151 /// Set character positions based on past pos/rot
You can’t perform that action at this time.
0 commit comments