Skip to content

Commit

Permalink
Rewiring of help component and other residual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMWWallace committed Nov 22, 2018
1 parent ecf5c90 commit d6b6cab
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 73 deletions.
5 changes: 5 additions & 0 deletions stratagems/gameplay/random_scrolls.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,8 @@ BEGIN
END


<<<<<<<< .../stratagems-inline/rndtres.2da
2DA V1.0
*
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
>>>>>>>>
4 changes: 4 additions & 0 deletions stratagems/genai/genai.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ DEFINE_ACTION_FUNCTION edit_creatures_before BEGIN

LAF edit_creature STR_VAR creature="%tutu_scripth%obelite" editstring="class=>FIGHTER dexterity=>15" END

// A couple of stray innocents need wtrunsgt, not wtasight

LAF edit_creature STR_VAR creature="waiter wareho" tv=1 editstring="strip_script=>%tutu_scriptw%tasight insert_script_low=>wtrunsgt" END

END // end of BG1 part

ACTION_IF is_bg2 BEGIN
Expand Down
44 changes: 44 additions & 0 deletions stratagems/help/baf/dw#innhl.baf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 57 is the baseline "shout" shout
// 119 is for dw#innhl and dw#urbhl
// we keep 57 for BG2 compatibility

IF
Allegiance(Myself,NEUTRAL)
OR(7)
AttackedBy([GOODCUTOFF.0.0.0.0.SUMMONED],DEFAULT)
AttackedBy([PC],DEFAULT)
AttackedBy([FAMILIAR],DEFAULT)
AttackedBy([ALLY],DEFAULT)
AttackedBy([CONTROLLED],DEFAULT)
AttackedBy([CHARMED],DEFAULT)
SpellCastOnMe([GOODCUTOFF.0.0.0.0.SUMMONED],0)
THEN
RESPONSE #100
Shout(57)
Shout(119)
Continue()
END

IF
HitBy([GOODCUTOFF],CRUSHING)
THEN
RESPONSE #100
Shout(57)
Shout(119)
Continue()
END

IF
OR(2)
Heard([ANYONE],119)
Heard([ANYONE],57)
Allegiance(Myself,NEUTRAL)

THEN
RESPONSE #100
SetGlobalTimer("runfromPC","LOCALS",60)
Continue()
END



178 changes: 157 additions & 21 deletions stratagems/help/help.tpa

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions stratagems/setup-stratagems.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ EMPTY_LANGUAGE
////////////////////////////////////////////////////////////////////
/////////////////////////////////////


/*
BEGIN test DESIGNATED 0
LAF run STR_VAR files=test location=test END

*/

///////////////////////////////////////////////////////////////////
////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions stratagems/tactical_bg1/c3assassin.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ DEFINE_ACTION_FUNCTION c3assassin_shared BEGIN

// sort out allegiance

LAF edit_creature STR_VAR creature=~lamalh molkar~ tv=1 editstring=~allegiance=>NEUTRAL strip_script=>shout~ END
LAF edit_creature STR_VAR creature=~maneir telka zeela drakar halaca morvin~ tv=1 editstring=~allegiance=>ENEMY strip_script=>shout~ END
LAF edit_creature STR_VAR creature=~lamalh molkar~ tv=1 editstring=~allegiance=>NEUTRAL strip_script=>"%tutu_var%shout dw#gpsht"~ END
LAF edit_creature STR_VAR creature=~maneir telka zeela drakar halaca morvin~ tv=1 editstring=~allegiance=>ENEMY strip_script=>"%tutu_var%shout dw#gpsht"~ END

// script tweak

Expand Down
25 changes: 15 additions & 10 deletions stratagems/tactical_bg1/cloakwood_druid.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ INCLUDE ~%scsroot%/lib/ai_wrap.tph~

DEFINE_ACTION_FUNCTION cloakwood_druid BEGIN

ACTION_IF FILE_EXISTS_IN_GAME "dw#gpsht.bcs" BEGIN
OUTER_SPRINT help_script dw#gpsht
END ELSE BEGIN
OUTER_SPRINT help_script shout
END

// make flunky-summoning script

Expand All @@ -27,9 +32,9 @@ END
MAKE_PATCH
level=>9
enforce_charclass=>is_bg1
insert_script_high=>gpshout
insert_script_high=>"%help_script%"
insert_script_high'=>dw#takiy
specifics=>90
specifics=>93
END
LAF edit_creature STR_VAR creature= ~%tutu_var%takiyah~ edits=patch_data editstring=~dv=>takiyah~ END

Expand All @@ -38,9 +43,9 @@ END
MAKE_PATCH
level=>9
enforce_charclass=>is_bg1
insert_script_high=>gpshout
insert_script_high=>"%help_script%"
insert_script_high'=>dw#izefi
specifics=>90
specifics=>93
END
LAF edit_creature STR_VAR creature= ~%tutu_var%izefia~ edits=patch_data editstring=~dv=>izefia~ END

Expand All @@ -49,9 +54,9 @@ END
MAKE_PATCH
level=>11
enforce_charclass=>is_bg1
insert_script_high=>gpshout
insert_script_high=>"%help_script%"
insert_script_high'=>dw#amara
specifics=>90
specifics=>93
END
LAF edit_creature STR_VAR creature=~%tutu_var%amaran~ edits=patch_data editstring=~dv=>amara~ END

Expand All @@ -68,8 +73,8 @@ END

MAKE_PATCH
add_items=>dw#attac
insert_script_high=>gpshout
specifics=>90
insert_script_high=>"%help_script%"
specifics=>93
END
LAF clone_creature STR_VAR creature= ~%tutu_var%druid3=>dw#takiy %tutu_var%druid3=>dw#izefi~
edits=patch_data
Expand All @@ -81,8 +86,8 @@ END

MAKE_PATCH
add_items=>dw#attac
insert_script_high=>gpshout
specifics=>90
insert_script_high=>"%help_script%"
specifics=>93
kit=>SHAPESHIFTER
dv=>dw#amara
add_items=>"dw#shnw1(WEAPON2)"
Expand Down
45 changes: 7 additions & 38 deletions stratagems/test/test.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ ACTION_IF GAME_IS iwdee BEGIN

END ELSE BEGIN


COPY_EXISTING "jaheir12.cre" override
LPF CRE_insert_script_second STR_VAR arguments="dw#test" END

/*
COPY_EXISTING_REGEXP GLOB ".*\.cre" override
COPY_EXISTING_REGEXP GLOB "[A-Z0-9][A-Z0-9].*\.cre" override
INNER_PATCH "%SOURCE_RES%" BEGIN
READ_ASCII 0x0 bdtest (2)
END
PATCH_IF "%bdtest%" STRING_COMPARE_CASE "BD" BEGIN
SET shouts=0
FOR (offset=0x248;offset<=0x268;offset+=8) BEGIN
READ_ASCII offset script
Expand All @@ -28,40 +27,10 @@ END ELSE BEGIN
END
END
PATCH_IF shouts BEGIN
READ_STRREF 0x8 name
READ_BYTE 0x274 specifics
PATCH_IF specifics>0 BEGIN
LPF log_this STR_VAR file=shout_specifics.txt input="%name%=%specifics% (%SOURCE_RES%)" END
END
READ_BYTE 0x273 class
PATCH_IF (class=155 || class=212) BEGIN
READ_BYTE 0x234 level
PATCH_IF ( level>1 || !(class=155) ) BEGIN
LPF log_this STR_VAR file=shout_innocent.txt input="%name% (%SOURCE_RES%)" END
END
END ELSE BEGIN
READ_BYTE 0x270 allegiance
PATCH_IF allegiance=255 BEGIN
LPF log_this STR_VAR file=shout_enemy.txt input="%name% (%SOURCE_RES%)" END
END ELSE BEGIN
LPF CRE_is_evil RET value END
PATCH_IF value BEGIN
LPF log_this STR_VAR file=shout_evil.txt input="%name% (%SOURCE_RES%)" END
END ELSE BEGIN
LPF CRE_is_good RET value END
PATCH_IF value BEGIN
LPF log_this STR_VAR file=shout_good.txt input="%name% (%SOURCE_RES%)" END
END ELSE BEGIN
LPF log_this STR_VAR file=shout_neutral.txt input="%name% (%SOURCE_RES%)" END
END
END
END
END


PATCH_PRINT "%SOURCE_RES%"
END
END
BUT_ONLY
*/
END


Expand Down

0 comments on commit d6b6cab

Please sign in to comment.