diff --git a/data/images/creatures/stalactite/stalactite_ice.sprite b/data/images/creatures/stalactite/stalactite_ice.sprite index 2b31e18d56a..c587e19b337 100644 --- a/data/images/creatures/stalactite/stalactite_ice.sprite +++ b/data/images/creatures/stalactite/stalactite_ice.sprite @@ -5,7 +5,7 @@ (images "stalactite_ice.png")) (action (name "yeti-stalactite") - (hitbox 0 15 32 48) + (hitbox 4 15 32 48) (images "../../engine/editor/stalactite_ice_yeti.png")) (action (name "squished") diff --git a/data/images/creatures/stalactite/stalactite_ice_yeti.png b/data/images/creatures/stalactite/stalactite_ice_yeti.png new file mode 100644 index 00000000000..1bf9fab547b Binary files /dev/null and b/data/images/creatures/stalactite/stalactite_ice_yeti.png differ diff --git a/data/images/creatures/stalactite/stalactite_rock_yeti.png b/data/images/creatures/stalactite/stalactite_rock_yeti.png new file mode 100644 index 00000000000..289c86484b8 Binary files /dev/null and b/data/images/creatures/stalactite/stalactite_rock_yeti.png differ diff --git a/data/images/creatures/yeti/busted1.png b/data/images/creatures/yeti/busted1.png deleted file mode 100644 index a6a3e5141d9..00000000000 Binary files a/data/images/creatures/yeti/busted1.png and /dev/null differ diff --git a/data/images/creatures/yeti/busted2.png b/data/images/creatures/yeti/busted2.png deleted file mode 100644 index 7047205bbb8..00000000000 Binary files a/data/images/creatures/yeti/busted2.png and /dev/null differ diff --git a/data/images/creatures/yeti/busted3.png b/data/images/creatures/yeti/busted3.png deleted file mode 100644 index eecdefdc4ec..00000000000 Binary files a/data/images/creatures/yeti/busted3.png and /dev/null differ diff --git a/data/images/creatures/yeti/hudlife.png b/data/images/creatures/yeti/hudlife.png index 5367977a8a7..a8ade542d7f 100644 Binary files a/data/images/creatures/yeti/hudlife.png and b/data/images/creatures/yeti/hudlife.png differ diff --git a/data/images/creatures/yeti/iceyeti_dust0.png b/data/images/creatures/yeti/iceyeti_dust0.png deleted file mode 100644 index f15850f6ceb..00000000000 Binary files a/data/images/creatures/yeti/iceyeti_dust0.png and /dev/null differ diff --git a/data/images/creatures/yeti/iceyeti_dust1.png b/data/images/creatures/yeti/iceyeti_dust1.png deleted file mode 100644 index b326a8b8fb5..00000000000 Binary files a/data/images/creatures/yeti/iceyeti_dust1.png and /dev/null differ diff --git a/data/images/creatures/yeti/iceyeti_dust2.png b/data/images/creatures/yeti/iceyeti_dust2.png deleted file mode 100644 index 054fd9c04fc..00000000000 Binary files a/data/images/creatures/yeti/iceyeti_dust2.png and /dev/null differ diff --git a/data/images/creatures/yeti/iceyeti_dust3.png b/data/images/creatures/yeti/iceyeti_dust3.png deleted file mode 100644 index 7a6eca6265f..00000000000 Binary files a/data/images/creatures/yeti/iceyeti_dust3.png and /dev/null differ diff --git a/data/images/creatures/yeti/idle-0.png b/data/images/creatures/yeti/idle-0.png new file mode 100644 index 00000000000..df23683c31a Binary files /dev/null and b/data/images/creatures/yeti/idle-0.png differ diff --git a/data/images/creatures/yeti/idle-1.png b/data/images/creatures/yeti/idle-1.png new file mode 100644 index 00000000000..70b6f5c84fa Binary files /dev/null and b/data/images/creatures/yeti/idle-1.png differ diff --git a/data/images/creatures/yeti/idle-2.png b/data/images/creatures/yeti/idle-2.png new file mode 100644 index 00000000000..a99e6b727a4 Binary files /dev/null and b/data/images/creatures/yeti/idle-2.png differ diff --git a/data/images/creatures/yeti/idle-3.png b/data/images/creatures/yeti/idle-3.png new file mode 100644 index 00000000000..b113435d3aa Binary files /dev/null and b/data/images/creatures/yeti/idle-3.png differ diff --git a/data/images/creatures/yeti/idle-4.png b/data/images/creatures/yeti/idle-4.png new file mode 100644 index 00000000000..31e8ac240b9 Binary files /dev/null and b/data/images/creatures/yeti/idle-4.png differ diff --git a/data/images/creatures/yeti/idle-5.png b/data/images/creatures/yeti/idle-5.png new file mode 100644 index 00000000000..19db57c5755 Binary files /dev/null and b/data/images/creatures/yeti/idle-5.png differ diff --git a/data/images/creatures/yeti/idle-6.png b/data/images/creatures/yeti/idle-6.png new file mode 100644 index 00000000000..4f52ef33074 Binary files /dev/null and b/data/images/creatures/yeti/idle-6.png differ diff --git a/data/images/creatures/yeti/idle-7.png b/data/images/creatures/yeti/idle-7.png new file mode 100644 index 00000000000..18375bf153d Binary files /dev/null and b/data/images/creatures/yeti/idle-7.png differ diff --git a/data/images/creatures/yeti/jump-0.png b/data/images/creatures/yeti/jump-0.png new file mode 100644 index 00000000000..7114070be1c Binary files /dev/null and b/data/images/creatures/yeti/jump-0.png differ diff --git a/data/images/creatures/yeti/jump-1.png b/data/images/creatures/yeti/jump-1.png new file mode 100644 index 00000000000..7dd24c68967 Binary files /dev/null and b/data/images/creatures/yeti/jump-1.png differ diff --git a/data/images/creatures/yeti/jump-2.png b/data/images/creatures/yeti/jump-2.png new file mode 100644 index 00000000000..6f3e3735536 Binary files /dev/null and b/data/images/creatures/yeti/jump-2.png differ diff --git a/data/images/creatures/yeti/jump-3.png b/data/images/creatures/yeti/jump-3.png new file mode 100644 index 00000000000..a3e2fc9f806 Binary files /dev/null and b/data/images/creatures/yeti/jump-3.png differ diff --git a/data/images/creatures/yeti/jump-4.png b/data/images/creatures/yeti/jump-4.png new file mode 100644 index 00000000000..ba222b71e74 Binary files /dev/null and b/data/images/creatures/yeti/jump-4.png differ diff --git a/data/images/creatures/yeti/jump-5.png b/data/images/creatures/yeti/jump-5.png new file mode 100644 index 00000000000..78464eb7928 Binary files /dev/null and b/data/images/creatures/yeti/jump-5.png differ diff --git a/data/images/creatures/yeti/leap-0.png b/data/images/creatures/yeti/leap-0.png new file mode 100644 index 00000000000..18932ab8dfd Binary files /dev/null and b/data/images/creatures/yeti/leap-0.png differ diff --git a/data/images/creatures/yeti/leap-1.png b/data/images/creatures/yeti/leap-1.png new file mode 100644 index 00000000000..007428587d3 Binary files /dev/null and b/data/images/creatures/yeti/leap-1.png differ diff --git a/data/images/creatures/yeti/leap-2.png b/data/images/creatures/yeti/leap-2.png new file mode 100644 index 00000000000..cc9c8d68408 Binary files /dev/null and b/data/images/creatures/yeti/leap-2.png differ diff --git a/data/images/creatures/yeti/leap-3.png b/data/images/creatures/yeti/leap-3.png new file mode 100644 index 00000000000..bd93ca0992a Binary files /dev/null and b/data/images/creatures/yeti/leap-3.png differ diff --git a/data/images/creatures/yeti/leap-4.png b/data/images/creatures/yeti/leap-4.png new file mode 100644 index 00000000000..1ee6de56a8c Binary files /dev/null and b/data/images/creatures/yeti/leap-4.png differ diff --git a/data/images/creatures/yeti/run-0.png b/data/images/creatures/yeti/run-0.png new file mode 100644 index 00000000000..c1268a3dac2 Binary files /dev/null and b/data/images/creatures/yeti/run-0.png differ diff --git a/data/images/creatures/yeti/run-1.png b/data/images/creatures/yeti/run-1.png new file mode 100644 index 00000000000..5ef2b65c74e Binary files /dev/null and b/data/images/creatures/yeti/run-1.png differ diff --git a/data/images/creatures/yeti/run-2.png b/data/images/creatures/yeti/run-2.png new file mode 100644 index 00000000000..be030d5561d Binary files /dev/null and b/data/images/creatures/yeti/run-2.png differ diff --git a/data/images/creatures/yeti/run-3.png b/data/images/creatures/yeti/run-3.png new file mode 100644 index 00000000000..da62ec7a491 Binary files /dev/null and b/data/images/creatures/yeti/run-3.png differ diff --git a/data/images/creatures/yeti/run-4.png b/data/images/creatures/yeti/run-4.png new file mode 100644 index 00000000000..b5183a70da4 Binary files /dev/null and b/data/images/creatures/yeti/run-4.png differ diff --git a/data/images/creatures/yeti/run-5.png b/data/images/creatures/yeti/run-5.png new file mode 100644 index 00000000000..2bb186f175f Binary files /dev/null and b/data/images/creatures/yeti/run-5.png differ diff --git a/data/images/creatures/yeti/run-6.png b/data/images/creatures/yeti/run-6.png new file mode 100644 index 00000000000..a371683e0bd Binary files /dev/null and b/data/images/creatures/yeti/run-6.png differ diff --git a/data/images/creatures/yeti/run-7.png b/data/images/creatures/yeti/run-7.png new file mode 100644 index 00000000000..5ae1afc7ede Binary files /dev/null and b/data/images/creatures/yeti/run-7.png differ diff --git a/data/images/creatures/yeti/stand-0.png b/data/images/creatures/yeti/stand-0.png new file mode 100644 index 00000000000..b8fcb5281e7 Binary files /dev/null and b/data/images/creatures/yeti/stand-0.png differ diff --git a/data/images/creatures/yeti/stand-1.png b/data/images/creatures/yeti/stand-1.png new file mode 100644 index 00000000000..11a2b176fdc Binary files /dev/null and b/data/images/creatures/yeti/stand-1.png differ diff --git a/data/images/creatures/yeti/stand-2.png b/data/images/creatures/yeti/stand-2.png new file mode 100644 index 00000000000..a66c72140c3 Binary files /dev/null and b/data/images/creatures/yeti/stand-2.png differ diff --git a/data/images/creatures/yeti/stand-3.png b/data/images/creatures/yeti/stand-3.png new file mode 100644 index 00000000000..861649d0cc5 Binary files /dev/null and b/data/images/creatures/yeti/stand-3.png differ diff --git a/data/images/creatures/yeti/stand-4.png b/data/images/creatures/yeti/stand-4.png new file mode 100644 index 00000000000..ed07fbd05c5 Binary files /dev/null and b/data/images/creatures/yeti/stand-4.png differ diff --git a/data/images/creatures/yeti/stand-5.png b/data/images/creatures/yeti/stand-5.png new file mode 100644 index 00000000000..c26916e401e Binary files /dev/null and b/data/images/creatures/yeti/stand-5.png differ diff --git a/data/images/creatures/yeti/stand-6.png b/data/images/creatures/yeti/stand-6.png new file mode 100644 index 00000000000..985ac9120bf Binary files /dev/null and b/data/images/creatures/yeti/stand-6.png differ diff --git a/data/images/creatures/yeti/stand-7.png b/data/images/creatures/yeti/stand-7.png new file mode 100644 index 00000000000..6d7f73a3a6d Binary files /dev/null and b/data/images/creatures/yeti/stand-7.png differ diff --git a/data/images/creatures/yeti/stomp-0.png b/data/images/creatures/yeti/stomp-0.png new file mode 100644 index 00000000000..260b6aab334 Binary files /dev/null and b/data/images/creatures/yeti/stomp-0.png differ diff --git a/data/images/creatures/yeti/stomp-1.png b/data/images/creatures/yeti/stomp-1.png new file mode 100644 index 00000000000..3653e5fa8d7 Binary files /dev/null and b/data/images/creatures/yeti/stomp-1.png differ diff --git a/data/images/creatures/yeti/stomp-2.png b/data/images/creatures/yeti/stomp-2.png new file mode 100644 index 00000000000..08b13e4c1ab Binary files /dev/null and b/data/images/creatures/yeti/stomp-2.png differ diff --git a/data/images/creatures/yeti/stomp-3.png b/data/images/creatures/yeti/stomp-3.png new file mode 100644 index 00000000000..cbef756f2eb Binary files /dev/null and b/data/images/creatures/yeti/stomp-3.png differ diff --git a/data/images/creatures/yeti/stomp-4.png b/data/images/creatures/yeti/stomp-4.png new file mode 100644 index 00000000000..441e7934416 Binary files /dev/null and b/data/images/creatures/yeti/stomp-4.png differ diff --git a/data/images/creatures/yeti/stomp-5.png b/data/images/creatures/yeti/stomp-5.png new file mode 100644 index 00000000000..94b4d233feb Binary files /dev/null and b/data/images/creatures/yeti/stomp-5.png differ diff --git a/data/images/creatures/yeti/stomp-6.png b/data/images/creatures/yeti/stomp-6.png new file mode 100644 index 00000000000..9e3cfccefbf Binary files /dev/null and b/data/images/creatures/yeti/stomp-6.png differ diff --git a/data/images/creatures/yeti/stomp-7.png b/data/images/creatures/yeti/stomp-7.png new file mode 100644 index 00000000000..749da05949b Binary files /dev/null and b/data/images/creatures/yeti/stomp-7.png differ diff --git a/data/images/creatures/yeti/stunned-0.png b/data/images/creatures/yeti/stunned-0.png new file mode 100644 index 00000000000..cefb4ac994f Binary files /dev/null and b/data/images/creatures/yeti/stunned-0.png differ diff --git a/data/images/creatures/yeti/stunned-1.png b/data/images/creatures/yeti/stunned-1.png new file mode 100644 index 00000000000..1e8aa1bbd02 Binary files /dev/null and b/data/images/creatures/yeti/stunned-1.png differ diff --git a/data/images/creatures/yeti/stunned-10.png b/data/images/creatures/yeti/stunned-10.png new file mode 100644 index 00000000000..d42fdcd0d2d Binary files /dev/null and b/data/images/creatures/yeti/stunned-10.png differ diff --git a/data/images/creatures/yeti/stunned-11.png b/data/images/creatures/yeti/stunned-11.png new file mode 100644 index 00000000000..9450e640430 Binary files /dev/null and b/data/images/creatures/yeti/stunned-11.png differ diff --git a/data/images/creatures/yeti/stunned-2.png b/data/images/creatures/yeti/stunned-2.png new file mode 100644 index 00000000000..3a4b2f360e9 Binary files /dev/null and b/data/images/creatures/yeti/stunned-2.png differ diff --git a/data/images/creatures/yeti/stunned-3.png b/data/images/creatures/yeti/stunned-3.png new file mode 100644 index 00000000000..18fddd1bf42 Binary files /dev/null and b/data/images/creatures/yeti/stunned-3.png differ diff --git a/data/images/creatures/yeti/stunned-4.png b/data/images/creatures/yeti/stunned-4.png new file mode 100644 index 00000000000..8306421ef23 Binary files /dev/null and b/data/images/creatures/yeti/stunned-4.png differ diff --git a/data/images/creatures/yeti/stunned-5.png b/data/images/creatures/yeti/stunned-5.png new file mode 100644 index 00000000000..385ac8894a6 Binary files /dev/null and b/data/images/creatures/yeti/stunned-5.png differ diff --git a/data/images/creatures/yeti/stunned-6.png b/data/images/creatures/yeti/stunned-6.png new file mode 100644 index 00000000000..28a09958240 Binary files /dev/null and b/data/images/creatures/yeti/stunned-6.png differ diff --git a/data/images/creatures/yeti/stunned-7.png b/data/images/creatures/yeti/stunned-7.png new file mode 100644 index 00000000000..6a18c523ce0 Binary files /dev/null and b/data/images/creatures/yeti/stunned-7.png differ diff --git a/data/images/creatures/yeti/stunned-8.png b/data/images/creatures/yeti/stunned-8.png new file mode 100644 index 00000000000..c1d3329536c Binary files /dev/null and b/data/images/creatures/yeti/stunned-8.png differ diff --git a/data/images/creatures/yeti/stunned-9.png b/data/images/creatures/yeti/stunned-9.png new file mode 100644 index 00000000000..7ae83c662b3 Binary files /dev/null and b/data/images/creatures/yeti/stunned-9.png differ diff --git a/data/images/creatures/yeti/throw-0.png b/data/images/creatures/yeti/throw-0.png new file mode 100644 index 00000000000..dd31a6b582c Binary files /dev/null and b/data/images/creatures/yeti/throw-0.png differ diff --git a/data/images/creatures/yeti/throw-1.png b/data/images/creatures/yeti/throw-1.png new file mode 100644 index 00000000000..1d2af423493 Binary files /dev/null and b/data/images/creatures/yeti/throw-1.png differ diff --git a/data/images/creatures/yeti/throw-10.png b/data/images/creatures/yeti/throw-10.png new file mode 100644 index 00000000000..31d421eeb71 Binary files /dev/null and b/data/images/creatures/yeti/throw-10.png differ diff --git a/data/images/creatures/yeti/throw-11.png b/data/images/creatures/yeti/throw-11.png new file mode 100644 index 00000000000..9df751eed50 Binary files /dev/null and b/data/images/creatures/yeti/throw-11.png differ diff --git a/data/images/creatures/yeti/throw-2.png b/data/images/creatures/yeti/throw-2.png new file mode 100644 index 00000000000..ece3e550b9d Binary files /dev/null and b/data/images/creatures/yeti/throw-2.png differ diff --git a/data/images/creatures/yeti/throw-3.png b/data/images/creatures/yeti/throw-3.png new file mode 100644 index 00000000000..f757e636626 Binary files /dev/null and b/data/images/creatures/yeti/throw-3.png differ diff --git a/data/images/creatures/yeti/throw-4.png b/data/images/creatures/yeti/throw-4.png new file mode 100644 index 00000000000..558d43a0c83 Binary files /dev/null and b/data/images/creatures/yeti/throw-4.png differ diff --git a/data/images/creatures/yeti/throw-5.png b/data/images/creatures/yeti/throw-5.png new file mode 100644 index 00000000000..3fc614aed61 Binary files /dev/null and b/data/images/creatures/yeti/throw-5.png differ diff --git a/data/images/creatures/yeti/throw-6.png b/data/images/creatures/yeti/throw-6.png new file mode 100644 index 00000000000..b560700325c Binary files /dev/null and b/data/images/creatures/yeti/throw-6.png differ diff --git a/data/images/creatures/yeti/throw-7.png b/data/images/creatures/yeti/throw-7.png new file mode 100644 index 00000000000..5746837c3b7 Binary files /dev/null and b/data/images/creatures/yeti/throw-7.png differ diff --git a/data/images/creatures/yeti/throw-8.png b/data/images/creatures/yeti/throw-8.png new file mode 100644 index 00000000000..101bdbfff72 Binary files /dev/null and b/data/images/creatures/yeti/throw-8.png differ diff --git a/data/images/creatures/yeti/throw-9.png b/data/images/creatures/yeti/throw-9.png new file mode 100644 index 00000000000..23d42d87674 Binary files /dev/null and b/data/images/creatures/yeti/throw-9.png differ diff --git a/data/images/creatures/yeti/y-jump.png b/data/images/creatures/yeti/y-jump.png deleted file mode 100644 index 63d880ba214..00000000000 Binary files a/data/images/creatures/yeti/y-jump.png and /dev/null differ diff --git a/data/images/creatures/yeti/y-jump2.png b/data/images/creatures/yeti/y-jump2.png deleted file mode 100644 index f150dc8eb73..00000000000 Binary files a/data/images/creatures/yeti/y-jump2.png and /dev/null differ diff --git a/data/images/creatures/yeti/y.png b/data/images/creatures/yeti/y.png deleted file mode 100644 index e04fdfdaf1d..00000000000 Binary files a/data/images/creatures/yeti/y.png and /dev/null differ diff --git a/data/images/creatures/yeti/y1.png b/data/images/creatures/yeti/y1.png deleted file mode 100644 index 8941dba97af..00000000000 Binary files a/data/images/creatures/yeti/y1.png and /dev/null differ diff --git a/data/images/creatures/yeti/y2.png b/data/images/creatures/yeti/y2.png deleted file mode 100644 index 3de9b204019..00000000000 Binary files a/data/images/creatures/yeti/y2.png and /dev/null differ diff --git a/data/images/creatures/yeti/y3.png b/data/images/creatures/yeti/y3.png deleted file mode 100644 index 29e79126249..00000000000 Binary files a/data/images/creatures/yeti/y3.png and /dev/null differ diff --git a/data/images/creatures/yeti/y4.png b/data/images/creatures/yeti/y4.png deleted file mode 100644 index bdc71266865..00000000000 Binary files a/data/images/creatures/yeti/y4.png and /dev/null differ diff --git a/data/images/creatures/yeti/y5.png b/data/images/creatures/yeti/y5.png deleted file mode 100644 index 0c2c081f3e4..00000000000 Binary files a/data/images/creatures/yeti/y5.png and /dev/null differ diff --git a/data/images/creatures/yeti/y6.png b/data/images/creatures/yeti/y6.png deleted file mode 100644 index 9037dd30b44..00000000000 Binary files a/data/images/creatures/yeti/y6.png and /dev/null differ diff --git a/data/images/creatures/yeti/y7.png b/data/images/creatures/yeti/y7.png deleted file mode 100644 index 3f4c416db06..00000000000 Binary files a/data/images/creatures/yeti/y7.png and /dev/null differ diff --git a/data/images/creatures/yeti/yeti.sprite b/data/images/creatures/yeti/yeti.sprite index 4d9b9ce9e22..d582700473b 100644 --- a/data/images/creatures/yeti/yeti.sprite +++ b/data/images/creatures/yeti/yeti.sprite @@ -1,70 +1,354 @@ (supertux-sprite (action - (name "walking-right") - (fps 4.0) - (hitbox 17 12 60 90) + (name "walk-left") + (fps 15) + (hitbox 31 27 72 100) (images - "y1.png" - "y2.png" - "y3.png" - "y4.png" - "y5.png" - "y6.png" - "y7.png" + "run-0.png" + "run-1.png" + "run-2.png" + "run-3.png" + "run-4.png" + "run-5.png" + "run-6.png" + "run-7.png" ) ) (action - (name "walking-left") - (mirror-action "walking-right") - (fps 4.0) - (hitbox 17 12 60 90) + (name "walk-right") + (mirror-action "walk-left") + (fps 15) + (hitbox 37 27 72 100) + ) + + (action + (name "jump-left") + (hitbox 31 27 72 100) + (fps 12) + (loop-frame 4) + (images + "jump-0.png" + "jump-1.png" + "jump-2.png" + "jump-3.png" + "jump-4.png" + "jump-5.png") ) (action (name "jump-right") + (mirror-action "jump-left") + (fps 12) + (loop-frame 4) + (hitbox 37 27 72 100) + ) + + (action + (name "fall-left") + (hitbox 31 27 72 100) + (fps 12) + (loops 1) (images - "yeti_jump.png" - ) - (hitbox 17 12 60 90) + "jump-3.png" + "jump-2.png" + "jump-1.png") ) (action - (name "jump-left") - (mirror-action "jump-right") - (hitbox 17 12 60 90) + (name "fall-right") + (mirror-action "fall-left") + (fps 12) + (loops 1) + (hitbox 37 27 72 100) ) + + (action + (name "stand-left") + (fps 10) + (hitbox 31 27 72 100) + (images "stand-0.png" + "stand-1.png" + "stand-2.png" + "stand-3.png" + "stand-4.png" + "stand-5.png" + "stand-6.png" + "stand-7.png") + ) (action (name "stand-right") + (fps 10) + (hitbox 37 27 72 100) + (mirror-action "stand-left") + ) + + (action + (name "rage-left") + (fps 18) + (loops 1) + (hitbox 31 27 72 100) + (images "idle-0.png" + "idle-1.png" + "idle-2.png" + "idle-3.png" + "idle-4.png" + "idle-5.png" + "idle-3.png" + "idle-6.png" + "idle-7.png" + "idle-3.png" + "idle-4.png" + "idle-5.png" + "idle-3.png" + "idle-6.png" + "idle-7.png" + "idle-3.png" + "idle-4.png" + "idle-5.png" + "idle-3.png" + "idle-6.png" + "idle-7.png" + "idle-3.png" + "idle-4.png" + "idle-5.png" + "idle-3.png" + "idle-6.png" + "idle-7.png" + "idle-3.png" + "idle-4.png" + "idle-5.png" + "idle-3.png" + "idle-6.png" + "idle-7.png" + "idle-3.png" + "idle-2.png" + "idle-1.png" + "stand-0.png") + ) + (action + (name "rage-right") + (fps 18) + (loops 1) + (hitbox 37 27 72 100) + (mirror-action "rage-left") + ) + + (action + (name "taunt-left") + (fps 18) + (loop-frame 4) + (hitbox 31 27 72 100) + (images "idle-0.png" + "idle-1.png" + "idle-2.png" + "idle-3.png" + "idle-4.png" + "idle-5.png" + "idle-3.png" + "idle-6.png" + "idle-7.png") + ) + (action + (name "taunt-right") + (fps 18) + (loop-frame 4) + (hitbox 37 27 72 100) + (mirror-action "taunt-left") + ) + + (action + (name "leap-left") + (hitbox 31 27 72 100) + (fps 15) + (loops 1) (images - "y.png" + "leap-0.png" + "leap-1.png" + "leap-2.png" + "leap-3.png" ) - (hitbox 17 12 60 90) ) (action - (name "stand-left") - (mirror-action "stand-right") - (hitbox 17 12 60 90) + (name "leap-right") + (mirror-action "leap-left") + (fps 15) + (hitbox 37 27 72 100) + ) + + (action + (name "stomp-left") + (hitbox 31 27 72 100) + (fps 15) + (loops 1) + (images + "stomp-0.png" + "stomp-1.png" + "stomp-2.png" + "stomp-3.png" + "stomp-4.png" + "stomp-5.png" + "stomp-6.png" + "stomp-7.png" + ) ) (action (name "stomp-right") + (mirror-action "stomp-left") + (fps 15) + (hitbox 37 27 72 100) + ) + + (action + (name "throw-left") + (fps 12) + (loops 1) + (hitbox 31 27 72 100) (images - "y-jump.png" + "throw-0.png" + "throw-1.png" + "throw-2.png" + "throw-3.png" + "throw-4.png" + "throw-5.png" + "throw-6.png" + "throw-7.png" + "throw-8.png" + "throw-9.png" + "stand-0.png" ) - (hitbox 17 12 60 90) ) (action - (name "stomp-left") - (mirror-action "stomp-right") - (hitbox 17 12 60 90) + (name "throw-right") + (mirror-action "throw-left") + (fps 12) + (loops 1) + (hitbox 37 27 72 100) + ) + +(action + (name "big-throw-left") + (fps 20) + (loops 1) + (hitbox 31 27 72 100) + (images + "stomp-7.png" + "stomp-6.png" + "stomp-5.png" + "stomp-4.png" + "stomp-3.png" + "stomp-2.png" + "stomp-4.png" + "stomp-3.png" + "stomp-2.png" + "stomp-3.png" + "stomp-2.png" + "stomp-2.png" + "stomp-2.png" + "stomp-2.png" + "stomp-6.png" + "idle-3.png" + "leap-3.png" + "leap-4.png" + "leap-4.png" + "leap-3.png" + "leap-2.png" + "leap-1.png" + "leap-0.png" + "stand-0.png" + ) + ) + (action + (name "big-throw-right") + (mirror-action "big-throw-left") + (fps 20) + (loops 1) + (hitbox 37 27 72 100) + ) + + (action + (name "dizzy-left") + (fps 15) + (hitbox 31 27 72 100) + (loop-frame 3) + (images + "jump-0.png" + "stomp-7.png" + "stunned-0.png" + "stunned-1.png" + "stunned-2.png" + "stunned-3.png" + "stunned-4.png" + "stunned-5.png" + "stunned-6.png" + "stunned-7.png" + ) ) (action - (name "dead") - (fps 3) + (name "dizzy-right") + (fps 15) + (mirror-action "dizzy-left") + (hitbox 37 27 72 100) + (loop-frame 3) + ) + + (action + (name "busted-left") + (fps 15) + (hitbox 31 27 72 100) (images - "busted1.png" - "busted1.png" - "busted2.png" - "busted1.png" - "busted2.png" + "stunned-8.png" + "stunned-9.png" + "stunned-10.png" + "stunned-11.png" ) - (hitbox 300 400 60 90) + ) + (action + (name "busted-right") + (fps 15) + (mirror-action "busted-left") + (hitbox 37 27 72 100) + ) + + (action + (name "grab-left") + (fps 12) + (loops 1) + (hitbox 31 27 72 100) + (images + "throw-7.png" + "throw-8.png" + "throw-9.png" + "stand-0.png" + "idle-1.png" + "idle-2.png" + ) + ) + (action + (name "grab-right") + (mirror-action "grab-left") + (fps 12) + (loops 1) + (hitbox 37 27 72 100) + ) + (action + (name "push-left") + (fps 12) + (loops 1) + (hitbox 31 27 72 100) + (images + "throw-10.png" + "throw-11.png" + "throw-5.png" + "throw-6.png" + "throw-7.png" + "throw-8.png" + "throw-9.png" + "stand-0.png" + ) + ) + (action + (name "push-right") + (mirror-action "push-left") + (fps 12) + (loops 1) + (hitbox 37 27 72 100) ) ) diff --git a/data/images/creatures/yeti/yeti_jump.png b/data/images/creatures/yeti/yeti_jump.png deleted file mode 100644 index fb4b4d71721..00000000000 Binary files a/data/images/creatures/yeti/yeti_jump.png and /dev/null differ diff --git a/src/badguy/yeti.cpp b/src/badguy/yeti.cpp index 91ae2aac79d..89a46f4e6af 100644 --- a/src/badguy/yeti.cpp +++ b/src/badguy/yeti.cpp @@ -17,12 +17,14 @@ #include "badguy/yeti.hpp" -#include +#include #include "audio/sound_manager.hpp" #include "badguy/bouncing_snowball.hpp" #include "badguy/yeti_stalactite.hpp" +#include "editor/editor.hpp" #include "math/random.hpp" +#include "math/util.hpp" #include "object/bigsnowball.hpp" #include "object/camera.hpp" #include "object/player.hpp" @@ -33,21 +35,26 @@ namespace { +const float ANNOUNCE_INTERVAL = 0.1f; + const float RUN_VX = 350; /**< Horizontal speed while running. */ const float RUN_PINCH_VX = 400; /**< Horizontal speed while running. */ -const float JUMP_UP_VY = -750; /**< Vertical speed while jumping on the dais. */ - +const float JUMP_UP_VY = -775; /**< Vertical speed while jumping on the dais. */ const float STOMP_VY = -300; /**< Vertical speed while stomping on the dais. */ -const float RUN_DISTANCE = 1060; /**< Distance between the x-coordinates of left and right end positions. */ -const float JUMP_SPACE = 448; /**< Distance between the jump position and the stand position. */ -const float BEFORE_WAIT = 3; -const float BALL_WAIT = 2; -const float STOMP_WAIT = 0.5; /**< Time we stay on the dais before jumping again. */ -const float SAFE_TIME = 1; /**< The time we are safe when Tux just hit us. */ +const float BALL_SPEED = 1.3f; +const float BALL_PINCH_SPEED = 1.5f; + +const float BEFORE_WAIT = 1.f; +const float BALL_WAIT = 0.8f; +const float STOMP_WAIT = 0.25f; /**< Time we stay on the dais before jumping again. */ +const float SAFE_TIME = 1.f; /**< The time we are safe when Tux just hit us. */ + +const float JUMP_SPACE = 13.5f * 32.f; /**< Distance between the jump position and the stand position. */ const float YETI_SQUISH_TIME = 3; +const float TUX_GRAB_DISTANCE = 100.f; const float SNOW_EXPLOSIONS_FREQUENCY = 8; /**< Number of snowball explosions per second. */ const int SNOW_EXPLOSIONS_COUNT = 5; /**< Number of snowballs per explosion. */ @@ -57,54 +64,56 @@ const float SNOW_EXPLOSIONS_VY = -200; /**< Speed of snowballs. */ Yeti::Yeti(const ReaderMapping& reader) : Boss(reader, "images/creatures/yeti/yeti.sprite"), - m_state(), + m_state(ANNOUNCE), + m_next_state(RUN), m_state_timer(), m_safe_timer(), - m_stomp_count(), + m_attacked(false), + m_attack_count(), m_left_stand_x(), m_right_stand_x(), m_left_jump_x(), m_right_jump_x(), - m_fixed_pos(), m_just_hit(), - m_just_threw(), - m_grabbed_tux(), - m_jumped() + m_pinch_announced(), + m_grabbed_tux() { reader.get("hud-icon", m_hud_icon, "images/creatures/yeti/hudlife.png"); m_hud_head = Surface::from_file(m_hud_icon); + + SoundManager::current()->preload("sounds/thud.ogg"); SoundManager::current()->preload("sounds/yeti_gna.wav"); SoundManager::current()->preload("sounds/yeti_roar.wav"); - - initialize(); - - reader.get("fixed-pos", m_fixed_pos, false); - if (m_fixed_pos) { - m_left_stand_x = 216; - m_right_stand_x = 1014; - m_left_jump_x = 528; - m_right_jump_x = 692; - } else { - recalculate_pos(); - } } void Yeti::initialize() { - m_dir = Direction::RIGHT; - run(); + recalculate_pos(); + + // Force all players to face the yeti because this way it looks epic... + // ... i think + bool playerdir = (invert_dir(m_dir) == Direction::RIGHT); + for (Player* player : Sector::get().get_players()) + { + player->set_dir(playerdir); + } + + m_next_state = RUN; + announce(false); } void Yeti::recalculate_pos() { + float sectorw = Sector::get().get_width(); + if (m_dir == Direction::RIGHT) { m_left_stand_x = m_col.m_bbox.get_left(); - m_right_stand_x = m_left_stand_x + RUN_DISTANCE; + m_right_stand_x = sectorw - m_left_stand_x - m_col.m_bbox.get_width(); } else { m_right_stand_x = m_col.m_bbox.get_left(); - m_left_stand_x = m_right_stand_x - RUN_DISTANCE; + m_left_stand_x = sectorw - m_right_stand_x; } m_left_jump_x = m_left_stand_x + JUMP_SPACE; @@ -125,147 +134,239 @@ void Yeti::active_update(float dt_sec) { Boss::boss_update(dt_sec); - auto player = get_nearest_player(); + Vector grab_pos = get_bbox().get_middle(); float push_distance; - push_distance = player ? (glm::length(get_bbox().get_middle() - player->get_bbox().get_middle())) : 0.f; + auto player = get_nearest_player(); + + push_distance = player ? glm::length(grab_pos - player->get_bbox().get_middle()) : 0.f; - if (on_ground() && (m_state == BE_ANGRY || m_state == THROW) && push_distance <= 160.f && m_physic.get_velocity_x() == 0.f) + if (player && on_ground() && is_idle() && + push_distance <= TUX_GRAB_DISTANCE && m_physic.get_velocity_x() == 0.f) { - m_state_timer.stop(); - m_physic.enable_gravity(false); - set_group(COLGROUP_DISABLED); - m_state = REMOVE_TUX; + throw_tux(); } switch (m_state) { - case RUN: - if (!m_just_threw || m_state_timer.check()) - { - set_action("jump", m_dir); - m_just_threw = false; - if (!m_jumped && (push_distance >= 160.f)) { - m_physic.set_velocity_y(STOMP_VY * 2.5f / 3.f); - m_jumped = true; - } + case ANNOUNCE: + if (m_next_state == ANNOUNCE) + break; - if (m_pinch_mode) + if (m_state_timer.check()) + { + if (m_next_state == RUN) { - if (std::abs(m_physic.get_velocity_x()) < (RUN_PINCH_VX - 10.f)) { - m_physic.set_acceleration_x(5.f * (m_dir == Direction::RIGHT ? RUN_PINCH_VX : -RUN_PINCH_VX)); - } - else - { - m_physic.set_acceleration_x(0.f); - m_physic.set_velocity_x(RUN_PINCH_VX * (m_dir == Direction::RIGHT ? 1.f : -1.f)); - } + run(false); + jump(STOMP_VY); } else { - if (std::abs(m_physic.get_velocity_x()) < (RUN_VX - 10.f)) { - m_physic.set_acceleration_x(5.f * (m_dir == Direction::RIGHT ? RUN_VX : -RUN_VX)); - } - else - { - m_physic.set_acceleration_x(0.f); - m_physic.set_velocity_x(RUN_VX * (m_dir == Direction::RIGHT ? 1.f : -1.f)); - } + m_pinch_announced = true; + idle(false, BEFORE_WAIT); } + } - if (((m_dir == Direction::RIGHT) && (get_pos().x >= m_right_jump_x)) || ((m_dir == Direction::LEFT) && (get_pos().x <= m_left_jump_x))) jump_up(); + if (m_sprite->animation_done()) + { + set_action("stand", m_dir); + m_state_timer.start(ANNOUNCE_INTERVAL); } + break; - case JUMP_UP: - if (((m_dir == Direction::RIGHT) && (get_pos().x >= m_right_stand_x)) || ((m_dir == Direction::LEFT) && (get_pos().x <= m_left_stand_x))) + + case JUMP: + if (m_sprite->animation_done()) + set_action("fall", m_dir); + + if (on_ground()) { - m_jumped = false; - m_dir = (m_dir == Direction::RIGHT) ? Direction::LEFT : Direction::RIGHT; - throw_snowballs(); + switch (m_next_state) + { + case RUN: + run(true); + break; + + case IDLE: + idle(true); + break; + + default: + break; + } } + break; - case THROW: - m_physic.set_velocity_x((std::abs(m_physic.get_velocity_x()) > 10.f) ? (m_physic.get_velocity_x() / 1.125f) : 0.f); - if (m_state_timer.check()) + + case RUN: + if ((m_dir == Direction::RIGHT && math::in_bounds(get_pos().x, m_right_jump_x, m_right_jump_x + 64.f)) || + (m_dir == Direction::LEFT && math::in_bounds(get_pos().x, m_left_jump_x - 64.f, m_left_jump_x))) { - summon_snowball(); - set_action("stand", m_dir); - m_stomp_count++; - if ((m_pinch_mode && m_stomp_count == 3) || (!m_pinch_mode && m_stomp_count == 2)) { - be_angry(); - } else { - m_state_timer.start(BALL_WAIT / (m_pinch_mode ? 1.2f : 1.f)); - } + m_next_state = IDLE; + jump(JUMP_UP_VY); } + break; - case THROW_BIG: - if (m_state_timer.check()) + + case IDLE: + if (m_sprite->animation_done()) { - summon_big_snowball(); + m_dir = invert_dir(m_dir); set_action("stand", m_dir); - m_stomp_count++; - if ((m_lives == 1 && m_stomp_count == 3) || (m_lives > 1 && m_stomp_count == 1)) { - m_just_threw = true; - run(); + m_state_timer.start(BEFORE_WAIT); + } + + if (m_state_timer.check()) + { + // If the player is dead, laugh at him. Forever. + if (!player) + { + m_next_state = ANNOUNCE; + announce(true); + break; } - else { - m_state_timer.start(BALL_WAIT); + + if (!m_pinch_announced && m_pinch_mode) + { + announce(false); + break; + } + + switch (m_next_state) + { + case RUN: + run(false); + jump(STOMP_VY); + break; + + case THROW: + throw_snowball(); + break; + + case STOMP: + stomp(); + break; + + case THROW_BIG: + throw_big_snowball(); + break; + + default: + break; } } + break; - case BE_ANGRY: - if (m_state_timer.check() && on_ground()) + + case THROW: + if (!m_attacked && m_sprite->get_current_frame() == 5) { - m_physic.set_velocity_y(STOMP_VY); - set_action("stomp", m_dir); - SoundManager::current()->play("sounds/yeti_gna.wav", get_pos()); + summon_snowball(); + m_attacked = true; + m_attack_count++; + break; } - break; - case SQUISHED: + + if (m_sprite->animation_done()) { - Direction newdir = (int(m_state_timer.get_timeleft() * SNOW_EXPLOSIONS_FREQUENCY) % 2) ? Direction::LEFT : Direction::RIGHT; - if (m_dir != newdir && m_dir == Direction::RIGHT) { - SoundManager::current()->play("sounds/stomp.wav", get_pos()); - add_snow_explosions(); - Sector::get().get_camera().shake(.05f, 0, 5); + if (m_attack_count >= (m_pinch_mode ? 3 : 2)) + { + m_next_state = STOMP; + m_attack_count = 0; } - m_dir = newdir; - set_action("jump", m_dir); + else + m_next_state = THROW; + + m_attacked = false; + idle(false, BALL_WAIT); } - if (m_state_timer.check()) + + break; + + case STOMP: + if (m_attacked && m_sprite->animation_done()) { - BadGuy::kill_fall(); - m_state = FALLING; - m_physic.set_velocity_y(JUMP_UP_VY / 2); // Move up a bit before falling - // Add some extra explosions. - for (int i = 0; i < 10; i++) { - add_snow_explosions(); + if (m_attack_count >= 3) + { + m_next_state = m_pinch_mode ? THROW_BIG : RUN; + m_attack_count = 0; } - run_dead_script(); + else + m_next_state = STOMP; + + m_attacked = false; + idle(false, STOMP_WAIT); } + break; - case FALLING: - break; - case REMOVE_TUX: - if (push_distance < 160.f && player) + + case THROW_BIG: + if (!m_attacked && m_sprite->get_current_frame() == 16) { - if (!m_grabbed_tux) { - player->get_physic().set_velocity(5.f * Vector(get_bbox().get_middle().x - player->get_bbox().get_middle().x, - get_bbox().get_middle().y - player->get_bbox().get_middle().y)); + summon_big_snowball(); + m_attacked = true; + m_attack_count++; + break; + } + + if (m_sprite->animation_done()) + { + if (m_attack_count >= 1) + { + m_next_state = RUN; + m_attack_count = 0; } - if (!m_grabbed_tux && push_distance < 10.f) + else + m_next_state = THROW_BIG; + + m_attacked = false; + idle(false, BALL_WAIT); + } + + break; + + case THROW_TUX: + if (!m_grabbed_tux && push_distance < TUX_GRAB_DISTANCE && player) + { + player->get_physic().set_velocity(5.f * (grab_pos - player->get_bbox().get_middle())); + + if (push_distance < 10.f) { m_state_timer.start(BALL_WAIT / 2.f); m_grabbed_tux = true; + + set_action("push", m_dir); player->get_physic().set_velocity(m_dir == Direction::RIGHT ? 600.f : -600.f, -200.f); } } + if (m_state_timer.check()) { set_group(COLGROUP_MOVING); m_physic.enable_gravity(true); m_grabbed_tux = false; - throw_snowballs(); + + m_next_state = THROW; + idle(false, BALL_WAIT); } + + break; + + case DIZZY: + if (m_state_timer.check() || + might_fall(BadGuy::s_normal_max_drop_height)) + { + bust(); + } + + break; + + case BUSTED: + if (m_state_timer.check()) + run_dead_script(); + + break; + + default: break; } @@ -273,51 +374,143 @@ Yeti::active_update(float dt_sec) } void -Yeti::run() +Yeti::announce(bool taunt) { - m_state = RUN; - m_state_timer.start(BEFORE_WAIT); + m_state = ANNOUNCE; + set_action(taunt ? "taunt" : "rage", m_dir); + m_state_timer.stop(); + + SoundManager::current()->play("sounds/yeti_roar.wav", get_pos()); } void -Yeti::jump_up() +Yeti::run(bool change_state) { + if (change_state) + { + m_state = RUN; + set_action("walk", m_dir); + m_state_timer.start(BEFORE_WAIT); + } + + if (m_pinch_mode) + m_physic.set_velocity_x(RUN_PINCH_VX * (m_dir == Direction::RIGHT ? 1.f : -1.f)); + else + m_physic.set_velocity_x(RUN_VX * (m_dir == Direction::RIGHT ? 1.f : -1.f)); +} + +void +Yeti::jump(float velocity) +{ + m_state = JUMP; set_action("jump", m_dir); - m_physic.set_velocity_y(JUMP_UP_VY); - m_state = JUMP_UP; + + m_physic.set_velocity_y(velocity); } void -Yeti::throw_snowballs() +Yeti::idle(bool stomp, float waitduration) { - // Turn around. - set_action("stand", m_dir); + m_state = IDLE; + set_action(stomp ? "stomp" : "stand", m_dir); + m_just_hit = false; + + m_state_timer.stop(); - m_stomp_count = 0; + if (stomp) + m_next_state = THROW; + else + m_state_timer.start(waitduration); + + m_physic.set_velocity_x(0); +} + +void +Yeti::throw_snowball() +{ m_state = THROW; + set_action("throw", m_dir); + m_state_timer.start(STOMP_WAIT / (m_pinch_mode ? 1.2f : 1.f)); } void -Yeti::throw_big_snowballs() +Yeti::throw_big_snowball() { - m_stomp_count = 0; m_state = THROW_BIG; + set_action("big-throw", m_dir, 0); + m_state_timer.start(BALL_WAIT); } void -Yeti::be_angry() +Yeti::stomp() { - m_stomp_count = 0; - m_state = BE_ANGRY; - m_state_timer.start(BALL_WAIT); + m_state = STOMP; + set_action("leap", m_dir); + + m_physic.set_velocity_y(STOMP_VY); + SoundManager::current()->play("sounds/yeti_gna.wav", get_pos()); +} + +void +Yeti::throw_tux() +{ + m_state = THROW_TUX; + set_action("grab", m_dir, 1); + m_attacked = false; + m_attack_count = 0; + + m_state_timer.stop(); + m_physic.enable_gravity(false); + set_group(COLGROUP_DISABLED); +} + +void +Yeti::turn_dizzy() +{ + // We're dead. + Direction old_dir = m_dir; + m_dir = invert_dir(old_dir); + + m_physic.set_velocity((m_dir == Direction::RIGHT ? RUN_VX : -RUN_VX) / 5, 0); + set_action("dizzy", old_dir); + + // NOTE: What? + // Set the badguy layer to be above the foremost, so that + // this does not reveal secret tilemaps: + //m_layer = Sector::get().get_foremost_opaque_layer() + 1; + + m_state = DIZZY; + set_group(COLGROUP_MOVING_ONLY_STATIC); + + m_state_timer.start(4.f); +} + +void +Yeti::bust() // You see, it's funny because +{ + m_state = BUSTED; + set_action("busted", invert_dir(m_dir)); + + m_physic.set_velocity_x(0); + Sector::get().get_camera().shake(.1f, 0, 16.f); + m_state_timer.start(1.5f); +} + +bool +Yeti::is_idle() +{ + return m_state == IDLE || + m_state == THROW || + m_state == THROW_BIG || + m_state == STOMP; } bool Yeti::collision_squished(MovingObject& object) { - if (m_state != YetiState::JUMP_UP && m_state != YetiState::RUN && m_state != YetiState::BE_ANGRY) { + if (m_state != YetiState::JUMP && m_state != YetiState::RUN && m_state != YetiState::STOMP) { return false; } @@ -342,7 +535,8 @@ Yeti::kill_squished(GameObject& object) } } -void Yeti::take_hit(Player& ) +void +Yeti::take_hit(Player& ) { if (m_safe_timer.started() || m_just_hit || std::abs(m_left_stand_x - get_pos().x) < 80 || std::abs(m_right_stand_x - get_pos().x) < 80) @@ -353,21 +547,10 @@ void Yeti::take_hit(Player& ) SoundManager::current()->play("sounds/yeti_roar.wav", get_pos()); m_lives--; - if (m_lives <= 0) { - // We're dead. - m_physic.set_velocity((m_dir == Direction::RIGHT ? RUN_VX : -RUN_VX) / 5, 0); - - // Set the badguy layer to be above the foremost, so that - // this does not reveal secret tilemaps: - m_layer = Sector::get().get_foremost_opaque_layer() + 1; - m_state = SQUISHED; - m_state_timer.start(YETI_SQUISH_TIME); - set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC); - // sprite->setAction("dead"); - } - else { + if (m_lives <= 0) + turn_dizzy(); + else m_safe_timer.start(SAFE_TIME); - } } void @@ -379,6 +562,8 @@ Yeti::kill_fall() void Yeti::drop_stalactite() { + SoundManager::current()->play("sounds/thud.ogg", get_pos()); + // Make a stalactite fall down and shake the camera a bit. Sector::get().get_camera().shake(.1f, 0, 20.f); @@ -391,13 +576,13 @@ Yeti::drop_stalactite() if (!m_pinch_mode) { // Drop stalactites within 3 units of player, going out with each jump. float distancex = fabsf(stalactite.get_bbox().get_middle().x - player->get_bbox().get_middle().x); - if (distancex < static_cast(m_stomp_count) * 32.0f) { + if (distancex < static_cast(m_attack_count) * 32.0f) { stalactite.start_shaking(); } } else { /* if (hitpoints < 3) */ // Drop every 3rd pair of stalactites. - if ((((static_cast(stalactite.get_pos().x) + 16) / 64) % 3) == (m_stomp_count % 3)) + if ((((static_cast(stalactite.get_pos().x) + 16) / 64) % 3) == (m_attack_count % 3)) stalactite.start_shaking(); } } @@ -408,88 +593,50 @@ void Yeti::summon_snowball() { Vector bs_pos = get_pos() + Vector(m_dir == Direction::LEFT ? -32.f : (get_bbox().get_width() + 1.f), 0.f); - Sector::get().add(bs_pos, m_dir, 150.f * (m_pinch_mode ? 1.2f : 1.f)); + Sector::get().add(bs_pos, m_dir, 150.f * (m_pinch_mode ? BALL_PINCH_SPEED : BALL_SPEED)); } void Yeti::summon_big_snowball() { - Vector bs_pos = Vector(get_bbox().get_middle().x - 44.f, get_bbox().get_top() - 89.f); - Sector::get().add(bs_pos, m_dir, true); + auto& ball = Sector::get().add(Vector(0,0), m_dir, true); + + float x = m_dir == Direction::LEFT ? get_bbox().get_left() - 32.f : get_bbox().get_right(); + Vector pos(x, get_bbox().get_top()); + ball.set_pos(pos); } void Yeti::collision_solid(const CollisionHit& hit) { update_on_ground_flag(hit); - if (hit.top || hit.bottom) { - // Hit floor or roof. - m_physic.set_velocity_y(0); - switch (m_state) { - case RUN: - if (!m_just_threw) { - set_action("walking", m_dir); - } - break; - case JUMP_UP: - break; - case THROW: - break; - case THROW_BIG: - break; - case BE_ANGRY: - // We just landed. - if (!m_state_timer.started()) - { - set_action("stand", m_dir); - m_stomp_count++; - drop_stalactite(); - - // Go to the other side after 3 jumps. - if (m_stomp_count == 3) - { - m_just_hit = false; - if (m_pinch_mode) { - throw_big_snowballs(); - } - else { - run(); - } - } - else - { - // Jump again. - m_state_timer.start(STOMP_WAIT / (m_pinch_mode ? 1.2f : 1.f)); - } - } - break; - case SQUISHED: - break; - case FALLING: - break; - case REMOVE_TUX: + if (!hit.bottom) + return; + + m_physic.set_velocity_y(0); + switch (m_state) + { + case STOMP: + if (m_attacked) break; - } - } else if (hit.left || hit.right) { - // Hit wall. - if(m_state != SQUISHED && m_state != FALLING) - jump_up(); - } -} -ObjectSettings -Yeti::get_settings() -{ - ObjectSettings result = Boss::get_settings(); + set_action("stomp", m_dir); + m_attack_count++; + m_attacked = true; + drop_stalactite(); - result.add_bool(_("Fixed position"), &m_fixed_pos, "fixed-pos", false); + break; - return result; + default: + break; + } } void Yeti::add_snow_explosions() { + // TODO: WAOW! This is terrible! Remove this! + /* for (int i = 0; i < SNOW_EXPLOSIONS_COUNT; i++) { Vector pos = get_pos(); Vector velocity(SNOW_EXPLOSIONS_VX * graphicsRandom.randf(0.5f, 2.0f) * (graphicsRandom.rand(2) ? 1.0f : -1.0f), @@ -500,6 +647,7 @@ Yeti::add_snow_explosions() velocity.x += m_physic.get_velocity_x(); Sector::get().add(pos, velocity); } + */ } Yeti::SnowExplosionParticle::SnowExplosionParticle(const Vector& pos, const Vector& velocity) @@ -514,7 +662,7 @@ Yeti::SnowExplosionParticle::SnowExplosionParticle(const Vector& pos, const Vect std::vector Yeti::get_allowed_directions() const { - return {}; + return { Direction::LEFT, Direction::RIGHT }; } /* EOF */ diff --git a/src/badguy/yeti.hpp b/src/badguy/yeti.hpp index 67742dc65c2..7ba2f27f9ce 100644 --- a/src/badguy/yeti.hpp +++ b/src/badguy/yeti.hpp @@ -39,19 +39,40 @@ class Yeti final : public Boss virtual std::string get_display_name() const override { return display_name(); } virtual GameObjectClasses get_class_types() const override { return Boss::get_class_types().add(typeid(Yeti)); } - virtual ObjectSettings get_settings() override; - void kill_squished(GameObject& object); protected: virtual std::vector get_allowed_directions() const override; private: - void run(); - void jump_up(); - void throw_snowballs(); - void throw_big_snowballs(); - void be_angry(); + enum YetiState { + ANNOUNCE, + RUN, + FALL, + JUMP, + IDLE, + THROW, + THROW_BIG, + STOMP, + DIZZY, + BUSTED, + THROW_TUX /// Yeti grabs Tux and throws him away. Take that! + }; + +private: + void announce(bool taunt); + void run(bool change_state); + void jump(float velocity); + void idle(bool stomp, float waitduration = 0); + void throw_snowball(); + void throw_big_snowball(); + void stomp(); + void throw_tux(); + void turn_dizzy(); + void bust(); + + bool is_idle(); + void drop_stalactite(); void summon_snowball(); void summon_big_snowball(); @@ -61,23 +82,14 @@ class Yeti final : public Boss void add_snow_explosions(); void recalculate_pos(); -private: - enum YetiState { - RUN, - JUMP_UP, - THROW, - THROW_BIG, - BE_ANGRY, - SQUISHED, - FALLING, - REMOVE_TUX - }; - private: YetiState m_state; + YetiState m_next_state; Timer m_state_timer; Timer m_safe_timer; - int m_stomp_count; + + bool m_attacked; + int m_attack_count; float m_left_stand_x; float m_right_stand_x; @@ -86,9 +98,8 @@ class Yeti final : public Boss bool m_fixed_pos; bool m_just_hit; - bool m_just_threw; + bool m_pinch_announced; bool m_grabbed_tux; - bool m_jumped; class SnowExplosionParticle: public BadGuy { diff --git a/src/object/bigsnowball.cpp b/src/object/bigsnowball.cpp index cd8265dff66..d8515ef323a 100644 --- a/src/object/bigsnowball.cpp +++ b/src/object/bigsnowball.cpp @@ -59,13 +59,12 @@ BigSnowball::BigSnowball(const Vector& pos, const Direction& dir, bool bounce) : m_dir(Direction::LEFT), m_speed(), m_break_on_impact(), - m_bounce() + m_bounce(bounce) { // settings used by Yeti when it throws it m_dir = dir; m_speed = SPEED_X; m_break_on_impact = true; - m_bounce = false; m_physic.set_velocity_x(m_dir == Direction::RIGHT ? SPEED_X : -SPEED_X); if (bounce) { m_physic.set_velocity_y(SPEED_Y); diff --git a/src/sprite/sprite.cpp b/src/sprite/sprite.cpp index 01441b33763..11d405324ae 100644 --- a/src/sprite/sprite.cpp +++ b/src/sprite/sprite.cpp @@ -137,7 +137,7 @@ Sprite::animation_done() const void Sprite::update() { - float frame_inc = m_action->fps * (g_game_time - m_last_ticks); + float frame_inc = m_last_ticks > 0.f ? m_action->fps * (g_game_time - m_last_ticks) : 0.f; m_last_ticks = g_game_time; if (m_is_paused) return; diff --git a/src/supertux/statistics.cpp b/src/supertux/statistics.cpp index cbda26ac933..d795e0a6b99 100644 --- a/src/supertux/statistics.cpp +++ b/src/supertux/statistics.cpp @@ -262,6 +262,8 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c { if (m_status != FINAL) return; + int layer = LAYER_GUI + 50; + int box_w = 220+110+110; int box_h = 30+20+20+20; int box_x = static_cast((static_cast(context.get_width()) - box_w) / 2); @@ -288,12 +290,12 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c context.push_transform(); context.set_alpha(0.5f); - context.color().draw_surface(backdrop, Vector(static_cast(bd_x), static_cast(bd_y)), LAYER_HUD); + context.color().draw_surface(backdrop, Vector(static_cast(bd_x), static_cast(bd_y)), layer); context.pop_transform(); - context.color().draw_text(Resources::normal_font, _("You"), Vector(col2_x, y), ALIGN_LEFT, LAYER_HUD, Statistics::header_color); + context.color().draw_text(Resources::normal_font, _("You"), Vector(col2_x, y), ALIGN_LEFT, layer, Statistics::header_color); if (best_stats) - context.color().draw_text(Resources::normal_font, _("Best"), Vector(col3_x, y), ALIGN_LEFT, LAYER_HUD, Statistics::header_color); + context.color().draw_text(Resources::normal_font, _("Best"), Vector(col3_x, y), ALIGN_LEFT, layer, Statistics::header_color); y += 10.f + y_offset; @@ -301,8 +303,8 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c if (target_time == 0.0f || (m_time != 0.0f && m_time < target_time)) tcolor = Statistics::perfect_color; - context.color().draw_text(Resources::normal_font, _("Time"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color); - context.color().draw_text(Resources::normal_font, time_to_string(m_time), Vector(col2_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, _("Time"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, layer, Statistics::header_color); + context.color().draw_text(Resources::normal_font, time_to_string(m_time), Vector(col2_x, y), ALIGN_LEFT, layer, tcolor); if (best_stats) { float time_best = (best_stats->m_time < m_time && best_stats->m_time > 0.0f) ? best_stats->m_time : m_time; @@ -310,20 +312,20 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c tcolor = Statistics::perfect_color; else tcolor = Statistics::text_color; - context.color().draw_text(Resources::normal_font, time_to_string(time_best), Vector(col3_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, time_to_string(time_best), Vector(col3_x, y), ALIGN_LEFT, layer, tcolor); } if (m_preferences.enable_coins) { y += y_offset; - context.color().draw_text(Resources::normal_font, _("Coins"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color); + context.color().draw_text(Resources::normal_font, _("Coins"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, layer, Statistics::header_color); if (m_coins >= m_total_coins) tcolor = Statistics::perfect_color; else tcolor = Statistics::text_color; - context.color().draw_text(Resources::normal_font, coins_to_string(m_coins, m_total_coins), Vector(col2_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, coins_to_string(m_coins, m_total_coins), Vector(col2_x, y), ALIGN_LEFT, layer, tcolor); if (best_stats) { @@ -333,7 +335,7 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c tcolor = Statistics::perfect_color; else tcolor = Statistics::text_color; - context.color().draw_text(Resources::normal_font, coins_to_string(coins_best, total_coins_best), Vector(col3_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, coins_to_string(coins_best, total_coins_best), Vector(col3_x, y), ALIGN_LEFT, layer, tcolor); } } @@ -345,8 +347,8 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c tcolor = Statistics::perfect_color; else tcolor = Statistics::text_color; - context.color().draw_text(Resources::normal_font, _("Badguys"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color); - context.color().draw_text(Resources::normal_font, frags_to_string(m_badguys, m_total_badguys), Vector(col2_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, _("Badguys"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, layer, Statistics::header_color); + context.color().draw_text(Resources::normal_font, frags_to_string(m_badguys, m_total_badguys), Vector(col2_x, y), ALIGN_LEFT, layer, tcolor); if (best_stats) { @@ -356,7 +358,7 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c tcolor = Statistics::perfect_color; else tcolor = Statistics::text_color; - context.color().draw_text(Resources::normal_font, frags_to_string(badguys_best, total_badguys_best), Vector(col3_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, frags_to_string(badguys_best, total_badguys_best), Vector(col3_x, y), ALIGN_LEFT, layer, tcolor); } } @@ -368,8 +370,8 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c tcolor = Statistics::perfect_color; else tcolor = Statistics::text_color; - context.color().draw_text(Resources::normal_font, _("Secrets"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color); - context.color().draw_text(Resources::normal_font, secrets_to_string(m_secrets, m_total_secrets), Vector(col2_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, _("Secrets"), Vector(col2_x - 16.f, y), ALIGN_RIGHT, layer, Statistics::header_color); + context.color().draw_text(Resources::normal_font, secrets_to_string(m_secrets, m_total_secrets), Vector(col2_x, y), ALIGN_LEFT, layer, tcolor); if (best_stats) { @@ -379,7 +381,7 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, c tcolor = Statistics::perfect_color; else tcolor = Statistics::text_color; - context.color().draw_text(Resources::normal_font, secrets_to_string(secrets_best, total_secrets_best), Vector(col3_x, y), ALIGN_LEFT, LAYER_HUD, tcolor); + context.color().draw_text(Resources::normal_font, secrets_to_string(secrets_best, total_secrets_best), Vector(col3_x, y), ALIGN_LEFT, layer, tcolor); } } }