From: <ave...@us...> - 2008-10-26 21:11:41
|
Revision: 5473 http://gemrb.svn.sourceforge.net/gemrb/?rev=5473&view=rev Author: avenger_teambg Date: 2008-10-26 21:11:36 +0000 (Sun, 26 Oct 2008) Log Message: ----------- implemented flashing of feetcircle when mouse is over an actor Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2008-10-26 21:01:52 UTC (rev 5472) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2008-10-26 21:11:36 UTC (rev 5473) @@ -702,20 +702,23 @@ BBox = newBBox; } +static const unsigned long tp_steps[8]={3,2,1,0,1,2,3,4}; + void Selectable::DrawCircle(Region &vp) { - /* TODO: BG2 colours ground circles as follows: - dark green for unselected party members - bright green for selected party members - flashing green/white for a party member the mouse is over - bright red for enemies - flashing red/white for enemies the mouse is over - flashing cyan/white for neutrals the mouse is over + /* BG2 colours ground circles as follows: + dark green for unselected party members + bright green for selected party members + flashing green/white for a party member the mouse is over + bright red for enemies + flashing red/white for enemies the mouse is over + flashing cyan/white for neutrals the mouse is over */ if (size<=0) { return; } + Color mix; Color* col = NULL; Sprite2D* sprite = circleBitmap[0]; @@ -723,7 +726,16 @@ col = &selectedColor; sprite = circleBitmap[1]; } else if (Over) { - col = &overColor; + //doing a time dependent flashing of colors + //if it is too fast, increase the 6 to 7 + unsigned long step; + GetTime( step ); + step = tp_steps [(step >> 6) & 7]; + mix.a=overColor.a; + mix.r=(overColor.r*step+selectedColor.r*(8-step))/8; + mix.g=(overColor.g*step+selectedColor.g*(8-step))/8; + mix.b=(overColor.b*step+selectedColor.b*(8-step))/8; + col = &mix; } else { return; } @@ -1126,8 +1138,6 @@ //don't call ReleaseCurrentAction } -static const unsigned long tp_steps[8]={3,2,1,0,1,2,3,4}; - void Movable::DrawTargetPoint(Region &vp) { if (!path || !Selected || (InternalFlags&IF_NORECTICLE) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-01-28 16:33:22
|
Revision: 5559 http://gemrb.svn.sourceforge.net/gemrb/?rev=5559&view=rev Author: fuzzie Date: 2009-01-28 16:33:18 +0000 (Wed, 28 Jan 2009) Log Message: ----------- move trap disarming code out of TryPickLock Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-01-28 12:14:56 UTC (rev 5558) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-01-28 16:33:18 UTC (rev 5559) @@ -1434,17 +1434,9 @@ { //first lets do this automatically succeeding //TODO: skill check, set off - Trapped = 0; - TrapDetected = 0; - LastDisarmed = actor->GetID(); - ImmediateEvent(); -} - -void Door::TryPickLock(Actor *actor) -{ if (Trapped) { - LastPickLockFailed = actor->GetID(); LastTrigger = actor->GetID(); + LastDisarmed = actor->GetID(); TrapDetected = 1; //trap fired if (!(Flags & DOOR_RESET) ) { @@ -1454,11 +1446,16 @@ ImmediateEvent(); return; } +} + +void Door::TryPickLock(Actor *actor) +{ if (actor->GetStat(IE_LOCKPICKING)<LockDifficulty) { if (LockDifficulty==100) { core->DisplayConstantStringName(STR_DOOR_NOPICK, 0xffffff, actor); } else { core->DisplayConstantStringName(STR_DOOR_CANTPICK, 0xffffff, actor); + LastPickLockFailed = actor->GetID(); } return; } @@ -1842,17 +1839,9 @@ { //first lets do this automatically succeeding //TODO: skill check, set off - Trapped = 0; - TrapDetected = 0; - LastDisarmed = actor->GetID(); - ImmediateEvent(); -} - -void Container::TryPickLock(Actor *actor) -{ if (Trapped) { - LastPickLockFailed = actor->GetID(); LastTrigger = actor->GetID(); + LastDisarmed = actor->GetID(); TrapDetected = 1; //trap fired if (!(Flags & CONT_RESET) ) { @@ -1862,11 +1851,16 @@ ImmediateEvent(); return; } +} + +void Container::TryPickLock(Actor *actor) +{ if (actor->GetStat(IE_LOCKPICKING)<LockDifficulty) { if (LockDifficulty==100) { core->DisplayConstantStringName(STR_CONT_NOPICK, 0xffffff, actor); } else { core->DisplayConstantStringName(STR_CONT_CANTPICK, 0xffffff, actor); + LastPickLockFailed = actor->GetID(); } return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2009-03-08 17:52:51
|
Revision: 5775 http://gemrb.svn.sourceforge.net/gemrb/?rev=5775&view=rev Author: zefklop Date: 2009-03-08 17:52:39 +0000 (Sun, 08 Mar 2009) Log Message: ----------- Fix typo. Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-08 17:47:12 UTC (rev 5774) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-08 17:52:39 UTC (rev 5775) @@ -1505,7 +1505,7 @@ if((str == 18) && strEx) { int tableEx = gamedata->LoadTable("STREXMOD"); TableMgr* tmEx = gamedata->GetTable(tableEx) ; - bonus += atoi(tmEx->QueryField(tm->GetRowName(str), "BEND_BARS_LIFT_GATES")) ; + bonus += atoi(tmEx->QueryField(tmEx->GetRowName(str), "BEND_BARS_LIFT_GATES")) ; } if(bonus < LockDifficulty) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-03-11 21:56:26
|
Revision: 5786 http://gemrb.svn.sourceforge.net/gemrb/?rev=5786&view=rev Author: avenger_teambg Date: 2009-03-11 21:56:05 +0000 (Wed, 11 Mar 2009) Log Message: ----------- Use preload StrengthBonus values Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-11 21:44:14 UTC (rev 5785) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-11 21:56:05 UTC (rev 5786) @@ -1496,28 +1496,22 @@ void Door::TryBashLock(Actor *actor) { - //Get the strength bonus agains lock difficulty - int str = actor->GetStat(IE_STR) ; - int strEx = actor->GetStat(IE_STREXTRA) ; - int table = gamedata->LoadTable("STRMOD"); - TableMgr* tm = gamedata->GetTable(table) ; - unsigned int bonus = atoi(tm->QueryField(tm->GetRowName(str), "BEND_BARS_LIFT_GATES")) ; - if((str == 18) && strEx) { - int tableEx = gamedata->LoadTable("STREXMOD"); - TableMgr* tmEx = gamedata->GetTable(tableEx) ; - bonus += atoi(tmEx->QueryField(tmEx->GetRowName(str), "BEND_BARS_LIFT_GATES")) ; - } + //Get the strength bonus agains lock difficulty + int str = actor->GetStat(IE_STR); + int strEx = actor->GetStat(IE_STREXTRA); + unsigned int bonus = core->GetStrengthBonus(2, str, strEx); //BEND_BARS_LIFT_GATES - if(bonus < LockDifficulty) { - core->DisplayConstantStringName(STR_DOORBASH_FAIL, 0xbcefbc, actor); - return ; - } + //bonus will never reach 100 + if(bonus < LockDifficulty) { + core->DisplayConstantStringName(STR_DOORBASH_FAIL, 0xbcefbc, actor); + return; + } - core->DisplayConstantStringName(STR_DOORBASH_DONE, 0xd7d7be, actor); - SetDoorLocked(false, true) ; - //Is this really useful ? - LastUnlocked = actor->GetID(); - ImmediateEvent(); + core->DisplayConstantStringName(STR_DOORBASH_DONE, 0xd7d7be, actor); + SetDoorLocked(false, true); + //Is this really useful ? + LastUnlocked = actor->GetID(); + ImmediateEvent(); } void Door::DebugDump() @@ -1922,28 +1916,22 @@ void Container::TryBashLock(Actor *actor) { - //Get the strength bonus agains lock difficulty - int str = actor->GetStat(IE_STR) ; - int strEx = actor->GetStat(IE_STREXTRA) ; - int table = gamedata->LoadTable("STRMOD"); - TableMgr* tm = gamedata->GetTable(table) ; - int bonus = atoi(tm->QueryField(tm->GetRowName(str), "BEND_BARS_LIFT_GATES")) ; - if((str == 18) && strEx) { - int tableEx = gamedata->LoadTable("STREXMOD"); - TableMgr* tmEx = gamedata->GetTable(tableEx) ; - bonus += atoi(tmEx->QueryField(tmEx->GetRowName(str), "BEND_BARS_LIFT_GATES")) ; - } - //bonus will never reach 100 - if(bonus < LockDifficulty) { - core->DisplayConstantStringName(STR_CONTBASH_FAIL, 0xbcefbc, actor); - return ; - } + //Get the strength bonus agains lock difficulty + int str = actor->GetStat(IE_STR); + int strEx = actor->GetStat(IE_STREXTRA); + unsigned int bonus = core->GetStrengthBonus(2, str, strEx); //BEND_BARS_LIFT_GATES - core->DisplayConstantStringName(STR_CONTBASH_DONE, 0xd7d7be, actor); - SetContainerLocked(false) ; - //Is this really useful ? - LastUnlocked = actor->GetID(); - ImmediateEvent(); + //bonus will never reach 100 + if(bonus < LockDifficulty) { + core->DisplayConstantStringName(STR_CONTBASH_FAIL, 0xbcefbc, actor); + return; + } + + core->DisplayConstantStringName(STR_CONTBASH_DONE, 0xd7d7be, actor); + SetContainerLocked(false); + //Is this really useful ? + LastUnlocked = actor->GetID(); + ImmediateEvent(); } void Container::DebugDump() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-03-11 22:33:04
|
Revision: 5788 http://gemrb.svn.sourceforge.net/gemrb/?rev=5788&view=rev Author: avenger_teambg Date: 2009-03-11 22:32:45 +0000 (Wed, 11 Mar 2009) Log Message: ----------- dump inventory of containers on ctrl-m Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-11 22:18:27 UTC (rev 5787) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-11 22:32:45 UTC (rev 5788) @@ -1946,4 +1946,5 @@ name = Scripts[0]->GetName(); } printf( "Script: %s, Key: %s\n", name, KeyResRef ); + inventory.dump(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-03-28 13:44:20
|
Revision: 5832 http://gemrb.svn.sourceforge.net/gemrb/?rev=5832&view=rev Author: avenger_teambg Date: 2009-03-28 13:44:07 +0000 (Sat, 28 Mar 2009) Log Message: ----------- fixed an uninitialised variable Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-28 13:43:01 UTC (rev 5831) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-03-28 13:44:07 UTC (rev 5832) @@ -65,6 +65,7 @@ startTime = 0; //executing scripts lastRunTime = 0; //evaluating scripts lastDelay = 0; + Dialog[0] = 0; interval = ( 1000 / AI_UPDATE_TIME ); WaitCounter = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-15 16:45:19
|
Revision: 5972 http://gemrb.svn.sourceforge.net/gemrb/?rev=5972&view=rev Author: fuzzie Date: 2009-05-15 16:45:11 +0000 (Fri, 15 May 2009) Log Message: ----------- try to handle entering non-trapped proximity infopoints Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-15 16:04:26 UTC (rev 5971) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-15 16:45:11 UTC (rev 5972) @@ -1676,10 +1676,17 @@ if (Flags&TRAP_DEACTIVATED) { return false; } - if (Highlightable::TriggerTrap(skill, ID) && !Trapped) { - Flags|=TRAP_DEACTIVATED; + if (!Trapped) { + // we have to set Entered somewhere, here seems best.. + LastEntered = ID; + return true; + } else if (Highlightable::TriggerTrap(skill, ID)) { + if (!Trapped) { + Flags|=TRAP_DEACTIVATED; + } + return true; } - return true; + return false; } bool InfoPoint::Entered(Actor *actor) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-15 19:21:27
|
Revision: 5977 http://gemrb.svn.sourceforge.net/gemrb/?rev=5977&view=rev Author: fuzzie Date: 2009-05-15 19:21:14 +0000 (Fri, 15 May 2009) Log Message: ----------- don't unset Trapped flag on infopoints when the trap is triggered Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-15 17:35:32 UTC (rev 5976) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-15 19:21:14 UTC (rev 5977) @@ -1684,6 +1684,9 @@ if (!Trapped) { Flags|=TRAP_DEACTIVATED; } + // ok, so this is a pain. Entered() trigger checks Trapped, + // so it needs to be kept set. how to do this right? + Trapped = true; return true; } return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-24 12:43:45
|
Revision: 6090 http://gemrb.svn.sourceforge.net/gemrb/?rev=6090&view=rev Author: fuzzie Date: 2009-05-24 12:19:31 +0000 (Sun, 24 May 2009) Log Message: ----------- another overhead text fix Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-24 12:18:17 UTC (rev 6089) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-24 12:19:31 UTC (rev 6090) @@ -49,6 +49,7 @@ Scripts[i] = NULL; } overHeadText = NULL; + overHeadTextPos.empty(); textDisplaying = 0; timeStartDisplaying = 0; scriptName[0] = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-05-25 18:33:27
|
Revision: 6104 http://gemrb.svn.sourceforge.net/gemrb/?rev=6104&view=rev Author: avenger_teambg Date: 2009-05-25 18:33:09 +0000 (Mon, 25 May 2009) Log Message: ----------- fixed searchmap eaten up by RandomWalk bug #2796306 Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-25 18:04:52 UTC (rev 6103) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-25 18:33:09 UTC (rev 6104) @@ -18,6 +18,7 @@ * $Id$ */ #include <cassert> +#include <cmath> #include "../../includes/win32def.h" #include "../../includes/strrefs.h" @@ -1133,8 +1134,18 @@ if (run) { InternalFlags|=IF_RUNNING; } - //area->BlockSearchMap( Pos, size, 0); + //the comment of the next line was removed in 0.4.0 + //if you want to put it back for some reason, check + //if the searchmap is not eaten up + area->BlockSearchMap( Pos, size, 0); Point p = Pos; + + //selecting points around a circle's edge around actor (didn't work better) + //int x = core->Roll(1,100,-50); + //p.x+=x; + //p.y+=(int) sqrt(100-x*x); + + //selecting points in a square around actor p.x+=core->Roll(1,50,-25); p.y+=core->Roll(1,50,-25); path = area->RunAway( Pos, p, size, 50, 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-05-27 20:00:40
|
Revision: 6130 http://gemrb.svn.sourceforge.net/gemrb/?rev=6130&view=rev Author: fuzzie Date: 2009-05-27 20:00:14 +0000 (Wed, 27 May 2009) Log Message: ----------- use IE_ANI_RUN when running Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-27 19:20:00 UTC (rev 6129) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-27 20:00:14 UTC (rev 6130) @@ -1035,6 +1035,9 @@ SetOrientation (step->orient, false); StanceID = IE_ANI_WALK; + if ((Type == ST_ACTOR) && (InternalFlags & IF_RUNNING)) { + StanceID = IE_ANI_RUN; + } Pos.x = ( step->x * 16 ) + 8; Pos.y = ( step->y * 12 ) + 6; if (!step->Next) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2009-05-29 16:16:53
|
Revision: 6182 http://gemrb.svn.sourceforge.net/gemrb/?rev=6182&view=rev Author: avenger_teambg Date: 2009-05-29 16:16:50 +0000 (Fri, 29 May 2009) Log Message: ----------- added skill check to remove traps Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-29 16:15:57 UTC (rev 6181) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-05-29 16:16:50 UTC (rev 6182) @@ -1509,24 +1509,22 @@ void Highlightable::TryDisarm(Actor *actor) { -//first lets do this automatically succeeding -//TODO: skill check, set off - if (Trapped) { - LastTrigger = actor->GetID(); + if (!Trapped || !TrapDetected) return; + + LastTrigger = actor->GetID(); + int skill = actor->GetStat(IE_TRAPS); + + if (skill/2+core->Roll(1,skill/2,0)>TrapRemovalDiff) { LastDisarmed = actor->GetID(); - SetTrapDetected(1); - //trap fired - if (!TrapResets()) { - //trap removed - Trapped = 0; - core->DisplayConstantStringName(STR_DISARM_DONE, 0xd7d7be, actor); - actor->AddExperience(XP_DISARM, actor->GetXPLevel(1)); - } else { - core->DisplayConstantStringName(STR_DISARM_FAIL, 0xd7d7be, actor); - } - ImmediateEvent(); - return; + //trap removed + Trapped = 0; + core->DisplayConstantStringName(STR_DISARM_DONE, 0xd7d7be, actor); + actor->AddExperience(XP_DISARM, actor->GetXPLevel(1)); + } else { + core->DisplayConstantStringName(STR_DISARM_FAIL, 0xd7d7be, actor); + TriggerTrap(skill, LastTrigger); } + ImmediateEvent(); } void Door::TryPickLock(Actor *actor) @@ -1620,10 +1618,8 @@ } return CT_GO_CLOSER; } - if(actor->IsSelected() ) - { - if(core->GetGame()->EveryoneNearPoint(actor->GetCurrentArea(), actor->Pos, ENP_CANMOVE|ENP_ONLYSELECT) ) - { + if(actor->IsSelected() ) { + if(core->GetGame()->EveryoneNearPoint(actor->GetCurrentArea(), actor->Pos, ENP_CANMOVE|ENP_ONLYSELECT) ) { return CT_MOVE_SELECTED; } return CT_SELECTED; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-01 18:06:30
|
Revision: 6240 http://gemrb.svn.sourceforge.net/gemrb/?rev=6240&view=rev Author: fuzzie Date: 2009-06-01 18:06:26 +0000 (Mon, 01 Jun 2009) Log Message: ----------- process actions immediately after any wait has expired Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 17:17:12 UTC (rev 6239) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 18:06:26 UTC (rev 6240) @@ -395,7 +395,7 @@ } if (WaitCounter) { WaitCounter--; - return; + if (WaitCounter) return; } //don't do anything while moving? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-01 18:34:27
|
Revision: 6242 http://gemrb.svn.sourceforge.net/gemrb/?rev=6242&view=rev Author: fuzzie Date: 2009-06-01 18:34:26 +0000 (Mon, 01 Jun 2009) Log Message: ----------- release NoInterrupt when finished walking (probably not the correct place to do this) Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 18:23:02 UTC (rev 6241) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 18:34:26 UTC (rev 6242) @@ -1046,6 +1046,8 @@ //since clearpath no longer sets currentaction to NULL //we set it here ReleaseCurrentAction(); + // try to release NoInterrupt at end of MoveToPoint etc + Interrupt(); return; } if (!walk_speed) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-01 18:44:44
|
Revision: 6243 http://gemrb.svn.sourceforge.net/gemrb/?rev=6243&view=rev Author: fuzzie Date: 2009-06-01 18:44:40 +0000 (Mon, 01 Jun 2009) Log Message: ----------- move the Interrupt call from r6242 to a better place Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 18:34:26 UTC (rev 6242) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 18:44:40 UTC (rev 6243) @@ -403,6 +403,9 @@ if (InMove()) { return; } + + // try to release NoInterrupt at end of MoveToPoint etc + Interrupt(); if (CurrentAction) { ReleaseCurrentAction(); @@ -1046,8 +1049,6 @@ //since clearpath no longer sets currentaction to NULL //we set it here ReleaseCurrentAction(); - // try to release NoInterrupt at end of MoveToPoint etc - Interrupt(); return; } if (!walk_speed) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-01 20:53:43
|
Revision: 6251 http://gemrb.svn.sourceforge.net/gemrb/?rev=6251&view=rev Author: fuzzie Date: 2009-06-01 20:53:24 +0000 (Mon, 01 Jun 2009) Log Message: ----------- revert unintended change in r6250 Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 20:49:30 UTC (rev 6250) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-01 20:53:24 UTC (rev 6251) @@ -398,9 +398,9 @@ if (WaitCounter) return; } - //don't do anything while moving without interruptions allowed + //don't do anything while moving? //maybe this should be fixed - if (InMove() && (InternalFlags & IF_NOINT)) { + if (InMove()) { return; } @@ -430,7 +430,7 @@ break; } //break execution in case of movement - if (InMove() && (InternalFlags & IF_NOINT)) { + if (InMove()) { break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-14 13:22:53
|
Revision: 6425 http://gemrb.svn.sourceforge.net/gemrb/?rev=6425&view=rev Author: fuzzie Date: 2009-06-14 13:22:51 +0000 (Sun, 14 Jun 2009) Log Message: ----------- don't draw actor recticles/circles in cutscenes Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-14 12:17:32 UTC (rev 6424) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-14 13:22:51 UTC (rev 6425) @@ -747,6 +747,11 @@ flashing cyan/white for neutrals the mouse is over */ + // ground circles are not drawn in cutscenes + // they SHOULD be drawn for at least white speaker circles (eg, via VerbalConstant), please fix :) + if ((core->GetGameControl()->GetScreenFlags()&SF_CUTSCENE)) + return; + if (size<=0) { return; } @@ -1204,6 +1209,10 @@ if (!path || !Selected || (InternalFlags&IF_NORECTICLE) ) return; + // recticles are never drawn in cutscenes + if ((core->GetGameControl()->GetScreenFlags()&SF_CUTSCENE)) + return; + // generates "step" from sequence 3 2 1 0 1 2 3 4 // updated each 1/15 sec unsigned long step; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-20 18:36:59
|
Revision: 6546 http://gemrb.svn.sourceforge.net/gemrb/?rev=6546&view=rev Author: fuzzie Date: 2009-06-20 18:36:53 +0000 (Sat, 20 Jun 2009) Log Message: ----------- traps shouldn't usually be detected on trigger Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-20 18:30:31 UTC (rev 6545) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-20 18:36:53 UTC (rev 6546) @@ -1795,9 +1795,10 @@ return false; } if (CanDetectTrap()) { - SetTrapDetected(1); //probably too late :) + // this should probably be party members only if ((skill>=100) && (skill!=256) ) skill = 100; if (skill/2+core->Roll(1,skill/2,0)>TrapDetectionDiff) { + SetTrapDetected(1); //probably too late :) //tumble??? return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-20 18:59:49
|
Revision: 6547 http://gemrb.svn.sourceforge.net/gemrb/?rev=6547&view=rev Author: fuzzie Date: 2009-06-20 18:59:43 +0000 (Sat, 20 Jun 2009) Log Message: ----------- don't trigger ST_PROXIMITY traps based on operating distance, it leads to disaster Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-20 18:36:53 UTC (rev 6546) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-20 18:59:43 UTC (rev 6547) @@ -1844,7 +1844,10 @@ goto check; } } - if (Distance(Pos, actor->Pos)<MAX_OPERATING_DISTANCE) { + // why is this here? actors which aren't *in* a trap get IF_INTRAP + // repeatedly unset, so this triggers again and again and again. + // i disabled it for ST_PROXIMITY for now.. + if (Type != ST_PROXIMITY && Distance(Pos, actor->Pos)<MAX_OPERATING_DISTANCE) { goto check; } if (Flags&TRAP_USEPOINT) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-22 13:21:52
|
Revision: 6572 http://gemrb.svn.sourceforge.net/gemrb/?rev=6572&view=rev Author: fuzzie Date: 2009-06-22 13:21:49 +0000 (Mon, 22 Jun 2009) Log Message: ----------- zero speeds means no movement Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-22 11:59:25 UTC (rev 6571) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-22 13:21:49 UTC (rev 6572) @@ -1081,17 +1081,19 @@ return true; } if (!time) time = core->GetGame()->Ticks; + if (!walk_speed) { + // zero speed: no movement + timeStartStep = time; + StanceID = IE_ANI_READY; + return true; + } if (!step) { step = path; timeStartStep = time; } else if (step->Next && (( time - timeStartStep ) >= walk_speed)) { //printf("[New Step] : Orientation = %d\n", step->orient); step = step->Next; - if (!walk_speed) { - timeStartStep = time; - } else { - timeStartStep = timeStartStep + walk_speed; - } + timeStartStep = timeStartStep + walk_speed; } SetOrientation (step->orient, false); StanceID = IE_ANI_WALK; @@ -1109,10 +1111,6 @@ ReleaseCurrentAction(); return true; } - if (!walk_speed) { - // with zero speed, all we can do is one step per frame - return true; - } if (( time - timeStartStep ) >= walk_speed) { // we didn't finish all pending steps, yet return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-22 16:06:03
|
Revision: 6577 http://gemrb.svn.sourceforge.net/gemrb/?rev=6577&view=rev Author: fuzzie Date: 2009-06-22 16:05:40 +0000 (Mon, 22 Jun 2009) Log Message: ----------- make trap projectiles launch from TrapLaunch point Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-22 15:31:04 UTC (rev 6576) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-22 16:05:40 UTC (rev 6577) @@ -600,7 +600,14 @@ SpellHeader = -1; if (pro) { pro->SetCaster(GetGlobalID()); - GetCurrentArea()->AddProjectile(pro, Pos, LastTargetPos); + Point origin = Pos; + if (Type == ST_TRIGGER || Type == ST_PROXIMITY) { + // try and make projectiles start from the right trap position + // see the traps in the dreugar/assassin battle in bg2 dungeon + // see also function below - maybe we should fix Pos instead + origin = ((InfoPoint *)this)->TrapLaunch; + } + GetCurrentArea()->AddProjectile(pro, origin, LastTargetPos); } LastTarget = 0; LastTargetPos.empty(); @@ -625,10 +632,17 @@ Projectile *pro = spl->GetProjectile(SpellHeader); if (pro) { pro->SetCaster(GetGlobalID()); + Point origin = Pos; + if (Type == ST_TRIGGER || Type == ST_PROXIMITY) { + // try and make projectiles start from the right trap position + // see the traps in the dreugar/assassin battle in bg2 dungeon + // see also function above - maybe we should fix Pos instead + origin = ((InfoPoint *)this)->TrapLaunch; + } if (LastTarget) { - GetCurrentArea()->AddProjectile(pro, Pos, LastTarget); + GetCurrentArea()->AddProjectile(pro, origin, LastTarget); } else { - GetCurrentArea()->AddProjectile(pro, Pos, LastTargetPos); + GetCurrentArea()->AddProjectile(pro, origin, LastTargetPos); } } gamedata->FreeSpell(spl, SpellResRef, false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-23 15:04:32
|
Revision: 6598 http://gemrb.svn.sourceforge.net/gemrb/?rev=6598&view=rev Author: fuzzie Date: 2009-06-23 15:04:30 +0000 (Tue, 23 Jun 2009) Log Message: ----------- make a hackish attempt to allow WalkTo() to re-path smoothly while moving Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-23 13:45:09 UTC (rev 6597) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-23 15:04:30 UTC (rev 6598) @@ -1179,14 +1179,52 @@ void Movable::WalkTo(Point &Des, int distance) { + Point from = Pos; + + // the prev_step stuff is a naive attempt to allow re-pathing while moving + PathNode *prev_step = NULL; + unsigned char old_stance = StanceID; + if (step && step->Next) { + // don't interrupt in the middle of a step; path from the next one + prev_step = new PathNode(*step); + from.x = ( step->Next->x * 16 ) + 8; + from.y = ( step->Next->y * 12 ) + 6; + } + ClearPath(); - FixPosition(); + if (!prev_step) { + FixPosition(); + } area->ClearSearchMapFor(this); - path = area->FindPath( Pos, Des, size, distance ); + path = area->FindPath( from, Des, size, distance ); //ClearPath sets destination, so Destination must be set after it //also we should set Destination only if there is a walkable path if (path) { Destination = Des; + + if (prev_step) { + // we want to smoothly continue, please + // this all needs more thought! but it seems to work okay + StanceID = old_stance; + + if (path->Next) { + // this is a terrible hack to make up for the + // pathfinder orienting the first node wrong + // should be fixed in pathfinder and not here! + Point next, follow; + next.x = path->x; next.y = path->y; + follow.x = path->Next->x; + follow.y = path->Next->y; + path->orient = GetOrient(follow, next); + } + + // then put the prev_step at the beginning of the path + prev_step->Next = path; + path->Parent = prev_step; + path = prev_step; + + step = path; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-23 15:21:11
|
Revision: 6599 http://gemrb.svn.sourceforge.net/gemrb/?rev=6599&view=rev Author: fuzzie Date: 2009-06-23 15:21:09 +0000 (Tue, 23 Jun 2009) Log Message: ----------- fix some bugs from the last commit Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-23 15:04:30 UTC (rev 6598) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-23 15:21:09 UTC (rev 6599) @@ -1179,8 +1179,8 @@ void Movable::WalkTo(Point &Des, int distance) { - Point from = Pos; - + Point from; + // the prev_step stuff is a naive attempt to allow re-pathing while moving PathNode *prev_step = NULL; unsigned char old_stance = StanceID; @@ -1188,12 +1188,13 @@ // don't interrupt in the middle of a step; path from the next one prev_step = new PathNode(*step); from.x = ( step->Next->x * 16 ) + 8; - from.y = ( step->Next->y * 12 ) + 6; + from.y = ( step->Next->y * 12 ) + 6; } ClearPath(); if (!prev_step) { FixPosition(); + from = Pos; } area->ClearSearchMapFor(this); path = area->FindPath( from, Des, size, distance ); @@ -1201,12 +1202,12 @@ //also we should set Destination only if there is a walkable path if (path) { Destination = Des; - + if (prev_step) { // we want to smoothly continue, please // this all needs more thought! but it seems to work okay StanceID = old_stance; - + if (path->Next) { // this is a terrible hack to make up for the // pathfinder orienting the first node wrong @@ -1222,9 +1223,15 @@ prev_step->Next = path; path->Parent = prev_step; path = prev_step; - + step = path; } + } else { + // pathing failed + if (prev_step) { + delete( prev_step ); + FixPosition(); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-06-24 13:02:01
|
Revision: 6611 http://gemrb.svn.sourceforge.net/gemrb/?rev=6611&view=rev Author: fuzzie Date: 2009-06-24 11:30:12 +0000 (Wed, 24 Jun 2009) Log Message: ----------- WalkTo shouldn't repath if we're already at the destination Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-24 09:56:47 UTC (rev 6610) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-06-24 11:30:12 UTC (rev 6611) @@ -1181,6 +1181,12 @@ { Point from; + // maybe caller should be responsible for this + if ((Des.x/16 == Pos.x/16) && (Des.y/12 == Pos.y/12)) { + ClearPath(); + return; + } + // the prev_step stuff is a naive attempt to allow re-pathing while moving PathNode *prev_step = NULL; unsigned char old_stance = StanceID; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fu...@us...> - 2009-07-01 14:47:18
|
Revision: 6670 http://gemrb.svn.sourceforge.net/gemrb/?rev=6670&view=rev Author: fuzzie Date: 2009-07-01 14:47:17 +0000 (Wed, 01 Jul 2009) Log Message: ----------- use FindPathNear when a distance is passed to Movable::WalkTo Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp Modified: gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-07-01 14:46:16 UTC (rev 6669) +++ gemrb/trunk/gemrb/plugins/Core/ActorBlock.cpp 2009-07-01 14:47:17 UTC (rev 6670) @@ -1203,7 +1203,11 @@ from = Pos; } area->ClearSearchMapFor(this); - path = area->FindPath( from, Des, size, distance ); + if (distance) { + path = area->FindPathNear( from, Des, size, distance ); + } else { + path = area->FindPath( from, Des, size, distance ); + } //ClearPath sets destination, so Destination must be set after it //also we should set Destination only if there is a walkable path if (path) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |