Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fofix/fofix
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsitton committed Sep 20, 2015
2 parents 8cbf5cf + 012e1ab commit d21b0cc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 47 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -160,6 +160,7 @@ The following packages are required:
* Cython ([link to 0.23](http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython))

This is a Python Wheel, after downloading install it using pip:

```pip install Cython‑0.23‑cp27‑none‑win32.whl```

The following packages are optional:
Expand Down
7 changes: 0 additions & 7 deletions fofix/game/guitarscene/GuitarScene.py
Expand Up @@ -4062,11 +4062,6 @@ def doPick3GH2(self, num, hopo = False, pullOff = False): #MFH - so DoPick knows
#Any previous notes missed, but new ones hit, reset streak counter
if len(self.instruments[num].missedNotes) > 0:

if self.hopoDebugDisp == 1 and not self.instruments[num].isDrum:
problemNoteMatchingList = [(int(tym), noat.number, noat.played) for tym, noat in self.instruments[num].matchingNotes]
Log.debug("Skipped note(s) detected in startpick3: %(missedNotes)s, notesToMatch: %(matchNotes)s, activeFrets: %(activeFrets)s, Song time=%(songTime)s" % \
{'missedNotes': str(self.instruments[num].missedNoteNums), 'matchNotes': str(problemNoteMatchingList), 'activeFrets': str(activeKeyList), 'songTime': str(self.timeLeft)})

scoreCard.streak = 0
if self.coOpType:
self.scoring[num].streak = 0
Expand All @@ -4078,8 +4073,6 @@ def doPick3GH2(self, num, hopo = False, pullOff = False): #MFH - so DoPick knows
for chord in self.instruments[num].missedNotes:
for tym, theNote in chord: #MFH
if not theNote.played and (theNote.star or theNote.finalStar):
if self.logStarpowerMisses == 1:
Log.debug("SP Miss: doPick3GH2(), afterStartPick3Ok-foundMissedCatchupNote: %d, gameTime: %s" % (theNote.number, self.timeLeft) )
self.starNotesMissed[num] = True
if self.unisonActive:
self.inUnison[num] = False
Expand Down
4 changes: 2 additions & 2 deletions fofix/game/guitarscene/instruments/Drum.py
Expand Up @@ -57,8 +57,8 @@
# to enable it, only here and Player.drums should need changing.

class Drum(Instrument):
def __init__(self, engine, playerObj, song, player = 0):
super(Drum, self).__init__(engine, playerObj, player, song)
def __init__(self, engine, playerObj, scene, player = 0):
super(Drum, self).__init__(engine, playerObj, scene, player=player)

self.isDrum = True
self.isBassGuitar = False
Expand Down
71 changes: 34 additions & 37 deletions fofix/game/guitarscene/instruments/Guitar.py
Expand Up @@ -66,7 +66,6 @@ def __init__(self, engine, playerObj, scene, player = 0, bass = False):
self.lastPlayedNotes = [] #MFH - for reverting when game discovers it implied incorrectly

self.missedNotes = []
self.missedNoteNums = []

self.freestyleHitFlameCounts = [0 for n in range(self.strings+1)] #MFH

Expand Down Expand Up @@ -501,7 +500,31 @@ def controlsMatchNotes(self, controls, notes):

return True


def controlsMatchNotes3(self, controls, notes, hopo = False):


def matchNotes(chordTuple, requiredKeys):
if len(chordTuple) > 1: #Chords must match exactly
for n in range(self.strings):
if (n in requiredKeys and not (controls.getState(self.keys[n]) or controls.getState(self.keys[n+5]))) or (n not in requiredKeys and (controls.getState(self.keys[n]) or controls.getState(self.keys[n+5]))):
return False
else: #Single Note must match that note
requiredKey = requiredKeys[0]
if not controls.getState(self.keys[requiredKey]) and not controls.getState(self.keys[requiredKey+5]):
return False


#myfingershurt: this is where to filter out higher frets held when HOPOing:
if hopo == False or self.hopoStyle == 2 or self.hopoStyle == 3:
#Check for higher numbered frets if not a HOPO or if GH2 strict mode
for n, k in enumerate(self.keys):
if (n > requiredKey and n < 5) or (n > 4 and n > requiredKey + 5):
#higher numbered frets cannot be held
if controls.getState(k):
return False
return True

# no notes?
if not notes:
return False
Expand All @@ -521,12 +544,11 @@ def controlsMatchNotes3(self, controls, notes, hopo = False):
chordlist.sort(key=lambda a: a[0][0])

self.missedNotes = []
self.missedNoteNums = []
twochord = 0

for chord in chordlist:
# matching keys?
requiredKeys = [note.number for time, note in chord]
requiredKeys = self.uniqify(requiredKeys)
requiredKeys = self.uniqify([note.number for time, note in chord])

if len(requiredKeys) > 2 and self.twoChordMax == True:
twochord = 0
Expand All @@ -539,7 +561,7 @@ def controlsMatchNotes3(self, controls, notes, hopo = False):
else:
twochord = 0

if (self.controlsMatchNote3(controls, chord, requiredKeys, hopo)):
if (matchNotes(chord, requiredKeys)):
if twochord != 2:
for time, note in chord:
note.played = True
Expand All @@ -557,12 +579,9 @@ def controlsMatchNotes3(self, controls, notes, hopo = False):
self.missedNotes.append(chord)
else:
self.missedNotes = []
self.missedNoteNums = []

for chord in self.missedNotes:
for time, note in chord:
if self.debugMode:
self.missedNoteNums.append(note.number)
note.skipped = True
note.played = False
if twochord == 2:
Expand All @@ -578,29 +597,6 @@ def uniqify(self, seq):
result.append(marker)
return result

def controlsMatchNote3(self, controls, chordTuple, requiredKeys, hopo):
if len(chordTuple) > 1:
#Chords must match exactly
for n in range(self.strings):
if (n in requiredKeys and not (controls.getState(self.keys[n]) or controls.getState(self.keys[n+5]))) or (n not in requiredKeys and (controls.getState(self.keys[n]) or controls.getState(self.keys[n+5]))):
return False
else:
#Single Note must match that note
requiredKey = requiredKeys[0]
if not controls.getState(self.keys[requiredKey]) and not controls.getState(self.keys[requiredKey+5]):
return False


#myfingershurt: this is where to filter out higher frets held when HOPOing:
if hopo == False or self.hopoStyle == 2 or self.hopoStyle == 3:
#Check for higher numbered frets if not a HOPO or if GH2 strict mode
for n, k in enumerate(self.keys):
if (n > requiredKey and n < 5) or (n > 4 and n > requiredKey + 5):
#higher numbered frets cannot be held
if controls.getState(k):
return False

return True

def startPick(self, song, pos, controls):
if not song:
Expand All @@ -611,18 +607,20 @@ def startPick(self, song, pos, controls):
self.playedNotes = []

if self.controlsMatchNotes(controls, self.matchingNotes):
self.pickStartPos = pos
for time, note in self.matchingNotes:
if note.skipped == True:
continue
self.pickStartPos = max(self.pickStartPos, time)

self.pickStartPos = max(pos, time)

note.played = True
self.playedNotes.append([time, note])
if self.guitarSolo:
self.currentGuitarSoloHitNotes += 1
return True
return False


def startPick3(self, song, pos, controls, hopo = False):
if not song:
return False
Expand All @@ -632,21 +630,20 @@ def startPick3(self, song, pos, controls, hopo = False):
self.lastPlayedNotes = self.playedNotes
self.playedNotes = []

self.controlsMatchNotes3(controls, self.matchingNotes, hopo)
self.controlsMatchNotes3(controls, self.matchingNotes, hopo=hopo)

#myfingershurt

for time, note in self.matchingNotes:
if note.played != True:
continue

self.pickStartPos = max(pos, time)

if shaders.turnon:
shaders.var["fret"][self.player][note.number]=shaders.time()
shaders.var["fretpos"][self.player][note.number]=pos


self.pickStartPos = pos
self.pickStartPos = max(self.pickStartPos, time)
if hopo:
note.hopod = True
else:
Expand Down
2 changes: 1 addition & 1 deletion fofix/game/guitarscene/instruments/Instrument.py
Expand Up @@ -2035,7 +2035,7 @@ def renderTails(self, visibility, song, pos, killswitch):
if self.notedisappear == 0:#Notes keep on going when missed
color = (.6, .6, .6, .5 * visibility * f)
elif self.notedisappear == 1:#Notes disappear when missed
color = (0.0, 0.0, 0.0, 0.0)
color = (.6, .6, .6, .5 * visibility * f)
if self.notedisappear == 2:#turn red when missed
color = (1, 0, 0, 1)

Expand Down

0 comments on commit d21b0cc

Please sign in to comment.