def check_holds(self, pid, curtime, arrows, steps, judge, toparrfx, holding): # FIXME THis needs to go away keymap_kludge = { "u": pad.UP, "k": pad.UPLEFT, "z": pad.UPRIGHT, "d": pad.DOWN, "l": pad.LEFT, "r": pad.RIGHT, "g": pad.DOWNRIGHT, "w": pad.DOWNLEFT, "c": pad.CENTER } for dir in self.game.dirs: toparrfx[dir].holding(0) current_hold = self.should_hold(steps, dir, curtime) dir_idx = self.game.dirs.index(dir) if current_hold is not None: if pad.states[(pid, keymap_kludge[dir])]: if judge.holdsub.get(holding[dir_idx]) != -1: toparrfx[dir].holding(1) holding[dir_idx] = current_hold botchdir, timef1, timef2 = steps.holdinfo[current_hold] for spr in arrows.sprites(): if (spr.endtime == timef1 and spr.dir == dir): spr.held() break else: if judge.holdsub.get(current_hold) != -1: botchdir, timef1, timef2 = steps.holdinfo[current_hold] for spr in arrows.sprites(): if (spr.endtime == timef1 and spr.dir == dir): if spr.broken_at(curtime, judge): args = (pid, curtime, dir, current_hold) for l in self.listeners: l.broke_hold(*args) break else: if holding[dir_idx] > -1: if judge.holdsub.get(holding[dir_idx]) != -1: args = (pid, curtime, dir, holding[dir_idx]) for l in self.listeners: l.ok_hold(*args) holding[dir_idx] = -1
def check_holds(self, pid, curtime, arrows, steps, judge, toparrfx, holding): for dir in self.game.dirs: toparrfx[dir].holding(0) current_hold = self.should_hold(steps, dir, curtime) dir_idx = self.game.dirs.index(dir) if current_hold is not None: if self.states.get((pid, dir), False): if judge.holdsub.get(holding[dir_idx]) != -1: toparrfx[dir].holding(1) holding[dir_idx] = current_hold botchdir, timef1, timef2 = steps.holdinfo[current_hold] for spr in arrows.sprites(): if (spr.endtime == timef1 and spr.dir == dir): spr.held() break else: if judge.holdsub.get(current_hold) != -1: botchdir, timef1, timef2 = steps.holdinfo[current_hold] for spr in arrows.sprites(): if (spr.endtime == timef1 and spr.dir == dir): if spr.broken_at(curtime, judge): args = (pid, curtime, dir, current_hold) for l in self.listeners: l.broke_hold(*args) break else: if holding[dir_idx] > -1: if judge.holdsub.get(holding[dir_idx]) != -1: args = (pid, curtime, dir, holding[dir_idx]) for l in self.listeners: l.ok_hold(*args) holding[dir_idx] = -1
def check_sprites(self, curtime, curbeat, arrows, steps, fx_data, judge): misses = judge.expire_arrows(curtime) for d in misses: for l in self.listeners: l.stepped(self.pid, d, curtime, -1, "M", self.combos.combo) for rating, dir, time in fx_data: if (rating == "V" or rating == "P" or rating == "G"): for spr in arrows.sprites(): if spr.endtime == time and spr.dir == dir: if not spr.hold: spr.kill() arrows.update(curtime, self.bpm, curbeat, judge) self.toparr_group.update(curtime, curbeat)