doodle/pkg/balance/cheats.go
Noah Petherbridge 9b75f1b039 Spit and polish
* New built-in wallpaper: "Dotted paper (dark)" is a dark-themed wallpaper.
* New built-in palette: "Neon Bright" with bright colors for dark levels.
* New cheat: "warp whistle" to automatically win the level.
* In case the user has a VERY LARGE screen resolution bigger than the full
  bounds of a Bounded level, the Play Scene will cap the size and center
  the level canvas onto the window. This is preferable to being able to see
  beyond the level's boundaries and hitting an invisible wall in-game.
* Make the titlescreen Lazy Scroll work on unbounded levels. It can't bounce
  off scroll boundaries but it will reverse course if it reaches the level's
  furthest limits.
* Bugfix: characters' white eyes were transparent in-game. Multiple culprits
  from the `doodad convert` tool defaulting the chroma key to white, to the
  SDL2 textures considering white to be transparent. For the latter, the game
  offsets the color by -1 blue.
2022-05-03 21:15:39 -07:00

52 lines
1.5 KiB
Go

package balance
// Store a copy of the PlayerCharacterDoodad original value.
var playerCharacterDefault string
func init() {
playerCharacterDefault = PlayerCharacterDoodad
}
// IsPlayerCharacterDefault returns whether the balance.PlayerCharacterDoodad
// has been modified at runtime away from its built-in default. This is a cheat
// detection method: high scores could be tainted if you `fly like a bird` right
// to the exit in a couple of seconds.
func IsPlayerCharacterDefault() bool {
return PlayerCharacterDoodad == playerCharacterDefault
}
// The game's cheat codes
var (
CheatUncapFPS = "unleash the beast"
CheatEditDuringPlay = "don't edit and drive"
CheatScrollDuringPlay = "scroll scroll scroll your boat"
CheatAntigravity = "import antigravity"
CheatNoclip = "ghost mode"
CheatShowAllActors = "show all actors"
CheatGiveKeys = "give all keys"
CheatGiveGems = "give all gems"
CheatDropItems = "drop all items"
CheatPlayAsBird = "fly like a bird"
CheatGodMode = "god mode"
CheatDebugLoadScreen = "test load screen"
CheatUnlockLevels = "master key"
CheatSkipLevel = "warp whistle"
)
// Global cheat boolean states.
var (
CheatEnabledUnlockLevels bool
)
// Actor replacement cheats
var CheatActors = map[string]string{
"pinocchio": "boy",
"the cell": "azu-blu",
"super azulian": "azu-red",
"hyper azulian": "azu-white",
"fly like a bird": "bird-red",
"bluebird": "bird-blue",
"megaton weight": "anvil",
"play as thief": "thief",
}