Created
December 28, 2019 03:59
-
-
Save seeya/709425b4bb44f3670be59732f2825d9a to your computer and use it in GitHub Desktop.
A snippet of Animal Restaurant source code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isFishCollision: function() { | |
return this.fishCollision; | |
}, | |
isWasScared: function() { | |
if (this.forceScared) { | |
var e = s.default[this.fishType].fishScared; | |
this.rate = e.rate; | |
return !0; | |
} | |
if (this.scaredCollision) { | |
var t = s.default[this.fishType].fishScared, i = t.pro, n = f(100, 0); | |
this.wasScared = n <= i; | |
if (this.wasScared) { | |
this.rate = t.rate; | |
return !0; | |
} | |
} | |
return !1; | |
}, | |
isWasHurt: function() { | |
return this.state === l.WasHurt; | |
}, | |
isMiss: function() { | |
return this.isWasHurt() && this.missed; | |
}, | |
isIdle: function() { | |
return this.state === l.Idle; | |
}, | |
isFloat: function() { | |
var e = s.default[this.fishType].float.pro; | |
return f(100, 0) <= e; | |
}, | |
isSwim: function() { | |
var e = s.default[this.fishType].swim.pro, t = f(100, 0); | |
this.swiming = t <= e; | |
return this.swiming; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment