[Clonekeenplus-commits] [SCM] clonekeenplus branch, master, updated. f3c08da2597679806b460f4b8a3498
Commander Keen Interpreter
Brought to you by:
gerstrong
From: Gerstrong <ger...@us...> - 2011-08-29 09:10:51
|
via f3c08da2597679806b460f4b8a3498e955f03d06 (commit) via 71f0a0a4da09e5c0e8ba4343a3f3aca1e51cf745 (commit) from 1e916e86bbac3cf94f3387edaf083f7db9fd82da (commit) - Log ----------------------------------------------------------------- commit f3c08da2597679806b460f4b8a3498e955f03d06 Author: Gerstrong <ger...@gm...> Date: Mon Aug 29 11:08:53 2011 +0200 Full Skypest AI is now in! commit 71f0a0a4da09e5c0e8ba4343a3f3aca1e51cf745 Author: Gerstrong <ger...@gm...> Date: Sun Aug 28 20:59:47 2011 +0200 Website Update ----------------------------------------------------------------------- Summary of changes: src/engine/galaxy/ai/CPlayerLevel.cpp | 1 - src/engine/galaxy/ai/CPlayerLevel.h | 8 +++ src/engine/galaxy/ai/ep4/CSkypest.cpp | 93 +++++++++++++++++++++++++++++++++ src/engine/galaxy/ai/ep4/CSkypest.h | 9 +++ website/download.html | 24 ++++---- website/news.html | 7 +++ 6 files changed, 129 insertions(+), 13 deletions(-) diff --git a/src/engine/galaxy/ai/CPlayerLevel.cpp b/src/engine/galaxy/ai/CPlayerLevel.cpp index 21f1684..d001d9a 100644 --- a/src/engine/galaxy/ai/CPlayerLevel.cpp +++ b/src/engine/galaxy/ai/CPlayerLevel.cpp @@ -272,7 +272,6 @@ void CPlayerLevel::processMovingHorizontal() - // Here all the pogo code is processed void CPlayerLevel::processPogo() { diff --git a/src/engine/galaxy/ai/CPlayerLevel.h b/src/engine/galaxy/ai/CPlayerLevel.h index b0cde7b..db31b6f 100644 --- a/src/engine/galaxy/ai/CPlayerLevel.h +++ b/src/engine/galaxy/ai/CPlayerLevel.h @@ -218,6 +218,14 @@ public: void openDoorsTile(); void processPlaceGem(); + // Checks if Keen is using the pogo. Skypest needs to know that, + // because it might get squashed. + bool isPogoing() + { + return (mp_processState == &CPlayerLevel::processPogo); + } + + bool m_jumpdownfromobject; diff --git a/src/engine/galaxy/ai/ep4/CSkypest.cpp b/src/engine/galaxy/ai/ep4/CSkypest.cpp index 71890ba..3301ea7 100644 --- a/src/engine/galaxy/ai/ep4/CSkypest.cpp +++ b/src/engine/galaxy/ai/ep4/CSkypest.cpp @@ -6,6 +6,7 @@ */ #include "CSkypest.h" +#include "engine/galaxy/ai/CPlayerLevel.h" namespace galaxy { @@ -13,16 +14,108 @@ namespace galaxy { #define A_SKYPEST_SQUISHED 2 #define A_SKYPEST_LICKEYES 3 +const int FLY_SPEED = 50; CSkypest::CSkypest(CMap *pmap, Uint32 x, Uint32 y) : CObject(pmap, x, y, OBJ_NONE) { setupGalaxyObjectOnMap(0x2486, A_SKYPEST_FLY); + mp_processState = &CSkypest::processFly; + m_hDir = RIGHT; + m_vDir = UP; +} + +bool CSkypest::isNearby(CObject &theObject) +{ + if(getActionStatus(A_SKYPEST_LICKEYES)) + { + if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) ) + { + const int dx = player->getXMidPos() - getXMidPos(); + + if( dx<0 ) + m_hDir = LEFT; + else + m_hDir = RIGHT; + } + } + return true; +} + +void CSkypest::getTouchedBy(CObject &theObject) +{ + if(dead || theObject.dead) + return; + + // When Keen touches the Council Member exit the level and add one to the council list + if( CPlayerLevel *Player = dynamic_cast<CPlayerLevel*>(&theObject) ) + { + // Check if player is using pogo and Skypest is licking + if( getActionStatus(A_SKYPEST_LICKEYES) || Player->isPogoing() ) + { + dead = true; + playSound(SOUND_SQUISH_SKYPEST); + setAction(A_SKYPEST_SQUISHED); + } + else + { + // else Keen will die + Player->kill(); + } + } +} + +void CSkypest::processOnFloor() +{ + if(getActionStatus(A_SKYPEST_FLY)) + { + mp_processState = &CSkypest::processFly; + blockedu = blockedd = false; + blockedl = blockedr = false; + setAction(A_SKYPEST_FLY); + } +} + +void CSkypest::processFly() +{ + // Flying to the direction Code + if(blockedd) + { + m_vDir = UP; + mp_processState = &CSkypest::processOnFloor; + setAction(A_SKYPEST_LICKEYES); + } + else if(blockedu) + { + m_vDir = DOWN; + } + + if(blockedl) + { + m_hDir = RIGHT; + } + else if(blockedr) + { + m_hDir = LEFT; + } + + // When someting is blocking change the direction + if(m_vDir == UP) + moveUp(FLY_SPEED); + else if(m_vDir == DOWN) + moveDown(FLY_SPEED); + + if(m_hDir == LEFT) + moveLeft(FLY_SPEED); + else if(m_hDir == RIGHT) + moveRight(FLY_SPEED); } void CSkypest::process() { processActionRoutine(); + + (this->*mp_processState)(); } } /* namespace galaxy */ diff --git a/src/engine/galaxy/ai/ep4/CSkypest.h b/src/engine/galaxy/ai/ep4/CSkypest.h index 3a6e9e5..57f8b95 100644 --- a/src/engine/galaxy/ai/ep4/CSkypest.h +++ b/src/engine/galaxy/ai/ep4/CSkypest.h @@ -18,6 +18,15 @@ public: CSkypest(CMap *pmap, Uint32 x, Uint32 y); void process(); + void getTouchedBy(CObject &theObject); + bool isNearby(CObject &theObject); + +private: + + void processOnFloor(); + void processFly(); + + void (CSkypest::*mp_processState)(); }; } /* namespace galaxy */ diff --git a/website/download.html b/website/download.html index 5fad864..5f72efa 100644 --- a/website/download.html +++ b/website/download.html @@ -83,31 +83,31 @@ <p> <img width = "32px" height = "30px" alt="Win7" src = "img/win7.png" /> - Windows (98, ME, 2000, XP, Vista, 7 and others) - Version 0.3.6.1 - - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-WIN32.exe/download">Installer (32 bit)</a> - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-WIN32.zip/download">ZIP Package (32 bit)</a> + Windows (98, ME, 2000, XP, Vista, 7 and others) - Version 0.3.7 - + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-WIN32.exe/download">Installer (32 bit)</a> + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-WIN32.zip/download">ZIP Package (32 bit)</a> </p> <p> <img width = "44px" height = "48px" alt="Linux" src = "img/linux.jpg" /> - Linux (Binary only) - Version 0.3.6.1 - - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-i386.tar.gz/download">32-bit</a> - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-amd64.tar.gz/download">64-bit</a> + Linux (Binary only) - Version 0.3.7 - + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-i386.tar.gz/download">32-bit</a> + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-amd64.tar.gz/download">64-bit</a> </p> <p> <img width = "48px" height = "44px" alt="Linux" src = "img/ubuntu.jpg" /> - Ubuntu Linux (11.04 and higher recommended) and Debian based distros - Version 0.3.6.1 - - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-i386.deb/download">32-bit</a> - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-amd64.deb/download">64-bit</a> + Ubuntu Linux (11.04 and higher recommended) and Debian based distros - Version 0.3.7 - + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-i386.deb/download">32-bit</a> + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-amd64.deb/download">64-bit</a> </p> <p> <img width = "48px" height = "44px" alt="Linux" src = "img/fedorasuse.png" /> - Fedora (15+) or OpenSuse (11.4+) and RPM based distros - Version 0.3.6.1 - - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-i386.rpm/download">32-bit</a> - <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.6/CGenius-0.3.6.1-amd64.rpm/download">64-bit</a> + Fedora (15+) or OpenSuse (11.4+) and RPM based distros - Version 0.3.7 - + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-i386.rpm/download">32-bit</a> + <a href="http://sourceforge.net/projects/clonekeenplus/files/Commander%20Genius/Version%200.3.7/CGenius-0.3.7-amd64.rpm/download">64-bit</a> </p> <p> diff --git a/website/news.html b/website/news.html index 46bb34f..e807b8e 100644 --- a/website/news.html +++ b/website/news.html @@ -72,6 +72,13 @@ <div></div> <h1>News</h1> <div class = "fauxTable"> + <h2>August 28th 2011</h2> + <p> + - Updated Commander Genius (ver. 0.3.7). + <a href = "download.html">Go check it out!</a> + </p> + </div> + <div class = "fauxTable"> <h2>August 3rd 2011</h2> <p> - Updated Commander Genius (ver. 0.3.6.1). hooks/post-receive -- clonekeenplus |