From: Laszlo T. <ave...@us...> - 2011-03-30 18:04:19
|
gemrb: Infinity Engine emulator The branch master has been updated via 88b03e719bd4684cb6fa6ad6403164488d507725 (commit) via 5e81b5a8a6f9cf04bb5585e77ab1e9ae51990a9b (commit) Summary of changes: gemrb/core/Scriptable/InfoPoint.cpp | 36 ---------------------------------- gemrb/core/Scriptable/InfoPoint.h | 1 - gemrb/core/Scriptable/Scriptable.cpp | 36 ++++++++++++++++++++++++++++++++++ gemrb/core/Scriptable/Scriptable.h | 4 +- 4 files changed, 38 insertions(+), 39 deletions(-) from 2e4d2b4edff9578c1be3fbd8c7188ea1459b9783 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=88b03e719bd4684cb6fa6ad6403164488d507725 commit 88b03e719bd4684cb6fa6ad6403164488d507725 Merge: 5e81b5a 2e4d2b4 Author: Avenger <ave...@so...> Date: Wed Mar 30 20:03:46 2011 +0200 Merge branch 'master' of ssh://gemrb.git.sourceforge.net/gitroot/gemrb/gemrb http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=5e81b5a8a6f9cf04bb5585e77ab1e9ae51990a9b commit 5e81b5a8a6f9cf04bb5585e77ab1e9ae51990a9b Author: Avenger <ave...@so...> Date: Wed Mar 30 20:03:04 2011 +0200 small cleanup after the explosion of ActorBlock diff --git a/gemrb/core/Scriptable/InfoPoint.cpp b/gemrb/core/Scriptable/InfoPoint.cpp index 0199bc7..40cbc57 100644 --- a/gemrb/core/Scriptable/InfoPoint.cpp +++ b/gemrb/core/Scriptable/InfoPoint.cpp @@ -52,7 +52,6 @@ InfoPoint::InfoPoint(void) TrapRemovalDiff = 0; TrapDetected = 0; TrapLaunch.empty(); - EnterWav[0] = 0; } InfoPoint::~InfoPoint(void) @@ -88,23 +87,6 @@ int InfoPoint::CheckTravel(Actor *actor) return CT_ACTIVE; } -//detect this trap, using a skill, skill could be set to 256 for 'sure' -//skill is the all around modified trap detection skill -//a trapdetectiondifficulty of 100 means impossible detection short of a spell -void Highlightable::DetectTrap(int skill) -{ - if (!CanDetectTrap()) return; - if (!Scripts[0]) return; - if ((skill>=100) && (skill!=256) ) skill = 100; - if (skill/2+core->Roll(1,skill/2,0)>TrapDetectionDiff) { - SetTrapDetected(1); //probably could be set to the player #? - } -} - -bool Highlightable::PossibleToSeeTrap() const -{ - return CanDetectTrap(); -} bool InfoPoint::PossibleToSeeTrap() const { @@ -142,24 +124,6 @@ bool Highlightable::VisibleTrap(int see_all) const } //trap that will fire now -bool Highlightable::TriggerTrap(int /*skill*/, ieDword ID) -{ - if (!Trapped) { - return false; - } - //actually this could be script name[0] - if (!Scripts[0] && !EnterWav[0]) { - return false; - } - LastTriggerObject = LastTrigger = LastEntered = ID; - ImmediateEvent(); - if (!TrapResets()) { - Trapped = false; - } - return true; -} - -//trap that will fire now bool InfoPoint::TriggerTrap(int skill, ieDword ID) { if (Type!=ST_PROXIMITY) { diff --git a/gemrb/core/Scriptable/InfoPoint.h b/gemrb/core/Scriptable/InfoPoint.h index 0eb6282..6ef5b90 100644 --- a/gemrb/core/Scriptable/InfoPoint.h +++ b/gemrb/core/Scriptable/InfoPoint.h @@ -62,7 +62,6 @@ public: ieStrRef StrRef; Point UsePoint; Point TalkPos; - }; #endif diff --git a/gemrb/core/Scriptable/Scriptable.cpp b/gemrb/core/Scriptable/Scriptable.cpp index e1bd727..483ae4c 100644 --- a/gemrb/core/Scriptable/Scriptable.cpp +++ b/gemrb/core/Scriptable/Scriptable.cpp @@ -1452,6 +1452,7 @@ Highlightable::Highlightable(ScriptableType type) Highlight = false; Cursor = IE_CURSOR_NORMAL; KeyResRef[0] = 0; + EnterWav[0] = 0; } Highlightable::~Highlightable(void) @@ -1482,6 +1483,24 @@ void Highlightable::SetCursor(unsigned char CursorIndex) Cursor = CursorIndex; } +//trap that will fire now +bool Highlightable::TriggerTrap(int /*skill*/, ieDword ID) +{ + if (!Trapped) { + return false; + } + //actually this could be script name[0] + if (!Scripts[0] && !EnterWav[0]) { + return false; + } + LastTriggerObject = LastTrigger = LastEntered = ID; + ImmediateEvent(); + if (!TrapResets()) { + Trapped = false; + } + return true; +} + bool Highlightable::TryUnlock(Actor *actor, bool removekey) { const char *Key = GetKey(); Actor *haskey = NULL; @@ -1521,6 +1540,23 @@ bool Highlightable::TryUnlock(Actor *actor, bool removekey) { return true; } +//detect this trap, using a skill, skill could be set to 256 for 'sure' +//skill is the all around modified trap detection skill +//a trapdetectiondifficulty of 100 means impossible detection short of a spell +void Highlightable::DetectTrap(int skill) +{ + if (!CanDetectTrap()) return; + if (!Scripts[0]) return; + if ((skill>=100) && (skill!=256) ) skill = 100; + if (skill/2+core->Roll(1,skill/2,0)>TrapDetectionDiff) { + SetTrapDetected(1); //probably could be set to the player #? + } +} + +bool Highlightable::PossibleToSeeTrap() const +{ + return CanDetectTrap(); +} /***************** * Movable Class * diff --git a/gemrb/core/Scriptable/Scriptable.h b/gemrb/core/Scriptable/Scriptable.h index 0e5a0c9..0e89f0d 100644 --- a/gemrb/core/Scriptable/Scriptable.h +++ b/gemrb/core/Scriptable/Scriptable.h @@ -176,8 +176,6 @@ public: Point Pos; ieStrRef DialogName; - //play this wav file when stepping on the trap - ieResRef EnterWav; GameScript* Scripts[MAX_SCRIPTS]; @@ -334,6 +332,8 @@ public: ieWord Trapped; ieWord TrapDetected; ieResRef KeyResRef; + //play this wav file when stepping on the trap (on PST) + ieResRef EnterWav; public: bool IsOver(const Point &Pos) const; void DrawOutline() const; ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |