This repository was archived by the owner on Oct 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,14 +287,34 @@ private void attack() {
287287 status = 0 ;
288288 }
289289
290- public void eval (Element [] streakElem ) {
291- // System.out.println(Arrays.toString(combo));
290+ // public void eval(Element[] streakElem) {
291+ // // System.out.println(Arrays.toString(combo));
292+ //
293+ // for (Combo combo : Combo.getCombosInUse()) {
294+ // if (Arrays.equals(streakElem, combo.getCombo())) {
295+ // info = "Combo completed!";
296+ // player.doAttack(monster.get(curFocus), combo);
297+ // streak.clear();
298+ // }
299+ // }
300+ //
301+ // }
302+
303+ private void eval (Element [] streakElem ) {
292304
293305 for (Combo combo : Combo .getCombosInUse ()) {
294- if (Arrays .equals (streakElem , combo .getCombo ())) {
295- info = "Combo completed!" ;
296- player .doAttack (monster .get (curFocus ), combo );
297- streak .clear ();
306+ Element [] elements = combo .getCombo ();
307+ if (streakElem .length >= elements .length ){
308+ for (int i = 1 ; i <= elements .length ; i ++){
309+ if (elements [elements .length - i ] != streakElem [streakElem .length - i ]){
310+ break ;
311+ }
312+ if (i == elements .length ){
313+ info = "Combo completed!" ;
314+ player .doAttack (monster .get (curFocus ), combo );
315+ streak .clear ();
316+ }
317+ }
298318 }
299319 }
300320
You can’t perform that action at this time.
0 commit comments