Skip to content

Commit

Permalink
Recompile all scripts and add changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
phobos2077 committed Jul 10, 2023
1 parent bd7288d commit 6314553
Show file tree
Hide file tree
Showing 36 changed files with 586 additions and 304 deletions.
28 changes: 28 additions & 0 deletions docs/ecco_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
-=== CHANGELOG ===-

v0.9.2
> Traps:
- new Bear Trap with mechanic for holding critter down for several turns
- remade internal mechanics for simpler scripts and more robust triggering (esp. out of combat)
- replaced linear skill-based damage curve for Spike Traps with critical hit chance (with cripple effects), based on modified vanilla critical roll formula - for ALL traps
- externalized all config to ini file (data/config folder) to allow traps to be easily ported to any game/mod
- slightly buffed explosives damage
- tweaked Modoc Brahmin quest to add delay before dogs attack (allows to prepare traps)

> Balance:
- replaced most of the EcCo maps changes with a new "map tweaker" script
- add varius crafting components and remove excessive loot in and around Den & Modoc
- slightly tweaked Tubby & friends to pose more of a threat
- increased frequency for some AI types to use bursts
- slight reduction to town demand multipliers
- removed all changes to Trapper script (Random Encounter) to allow buying and selling pelts with a profit
- various balance tweaks to crafting recipes
- add crafting components and a few new items to random encounter containers
- Vegeir: replaced Assault Rifle reward with Hunting Rifle

> Other:
- fixed empty Jo's shop inventory
- changed crafting hotkey back to Ctrl+C (to avoid conflict with party_orders mod)
- better Fix Boy button art
- fixed Geckos and Rats being attracted to food from across the map
- inventory AP cost is also applied when using certain items (such as explosives)


v0.9.1
- fixed several broken global scripts
- fixed several bugs with crafting UI
Expand Down
29 changes: 29 additions & 0 deletions docs/ecco_changelog_ru.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
-=== СПИСОК ИЗМЕНЕНИЙ ===-

v0.9.2
> Ловушки:
- новый тип ловушки - капкан, способный удерживать противника в течении нескольких ходов
- переделана внутренняя механика системы для упрощения скриптов и более надёжного срабатывания (особенно вне боя)
- замененена линейное повышение урона от навыка на шанс крит. урона (в т.ч. поврежд. конечностей) на основе изменённой оригинальной формулы критов
- вынесены все настройки в ini-файл для простого переноса системы в другие моды
- немного повышен урон взрывчатки
- в квесте по защите браминов от собак в Модоке добавлена задержка для возможности подготовить ловушки

> Баланс:
- заменена большая часть изменённых модом карт на новый скрипт "хирургических правок"
- добавлены разные компоненты для крафта и удален лут в локациях вокруг Дена и Модока
- немного усилен Тубби и его товарищи
- повышена вероятность очереди для некоторых типов ИИ
- немного снижены множители спроса на шкуры в городах
- убраны все изменения в скрипт Трэппера (случ. встреча) чтобы можно было заработать на перепродаже шкур
- балансные правки некоторых рецептов
- добавлены компоненты крафта в контейнеры в случайные встречи
- заменёна Штурмовая Винтовка на Охотничью в награду за квест в Модоке

> Прочее:
- исправлен пустой инвентарь Джо
- возвращёно сочетание клавиш Ctrl+C для крафта
- добавлено несколько недостающих строк в глобалке и квестах
- улучшен вид кнопка крафта
- исправлены Гэкко и крысы прибегающие за едой через всю карту
- добавлена стоимость ОД использования взрывчатки в бою


v0.9.1
- исправлено несколько сломаных скриптов
- исправлено несколько багов с интерфейсом ремесла
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion extra/bin/compile_wcc.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ wcc386.exe %1 -plw=0 -fo="%~nx1.i" -w4 -wcd123 -wcd138
compile.exe -q -l -O2 -s "%~nx1.i" -o %3
SET compileErr=%ERRORLEVEL%
del "%~nx1.i"
exit %compileErr%
exit /B %compileErr%
2 changes: 1 addition & 1 deletion extra/compile_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SET compile=%root%\extra\bin\compile.exe
cd /d "%root%/scripts_src"

for /r %%i in (*.ssl) do (
echo %%~dpi | findstr /v /i "\\tests\\ \\wip\\" >nul && (
echo %%~dpi | findstr /v /i "\\tests\\ \\wip\\ zilocker" >nul && (
cd /d "%%~dpi"
"%compile%" -l -O2 -p -s -q -n "%%~nxi" -o "%output%/%%~ni.int"
)
Expand Down
1 change: 0 additions & 1 deletion extra/decompilescripts.cmd → extra/decompile_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ for /f "tokens=* delims=" %%I in ('dir *.int /b') do (

echo Done!
pause
cls
14 changes: 14 additions & 0 deletions extra/dump_all.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@ECHO OFF

set int2ssl=%CD%\bin\int2ssl.exe

cd ..\root\data\scripts
mkdir _dump

for /f "tokens=* delims=" %%I in ('dir *.int /b') do (
%int2ssl% -d "%%I"
move /Y %%~nI.dump _dump\
)

echo Done!
pause
Binary file modified root/data/scripts/ecrobber.int
Binary file not shown.
Binary file modified root/data/scripts/gl_expforkill_mod.int
Binary file not shown.
Binary file modified root/data/scripts/gl_pbs_barter.int
Binary file not shown.
Binary file modified root/data/scripts/gl_pbs_craft.int
Binary file not shown.
Binary file modified root/data/scripts/gl_pbs_damage_mod.int
Binary file not shown.
Binary file modified root/data/scripts/gl_pbs_sneak_knockout.int
Binary file not shown.
Binary file modified root/data/scripts/gl_spray_settings.int
Binary file not shown.
Binary file modified root/data/scripts/gl_throwing_bonus.int
Binary file not shown.
Binary file modified root/data/scripts/gl_update_map_objs_from_proto.int
Binary file not shown.
Binary file modified root/data/scripts/mcbaltha.int
Binary file not shown.
Binary file modified root/data/scripts/nceldrid.int
Binary file not shown.
Binary file modified root/data/scripts/rcascort.int
Binary file not shown.
Binary file modified root/data/scripts/schenry.int
Binary file not shown.
12 changes: 6 additions & 6 deletions scripts_src/_pbs_craft/crafting.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ procedure batch_item(variable num) begin
while (field(line) != ITEM_COMPONENTS and line < SECTION_STEP) do line += 1;
line += 1;
while (line < SECTION_STEP and field(line) != "Error" and bstr(cur_section_start) == ITEM_ITEM) do begin
orList := string_split_safe(field(line), "|");
orList := string_split(field(line), "|");
i := 0;
// remove first item from "OR" orList that player has
while (i < len_array(orList)) do begin
Expand Down Expand Up @@ -598,7 +598,7 @@ procedure undo_batch(variable num) begin
while (field(line) != ITEM_COMPONENTS and line < SECTION_STEP) do line += 1;
line += 1;
while (line < SECTION_STEP and field(line) != "Error" and bstr(cur_section_start) == ITEM_ITEM) do begin
orList := string_split_safe(field(line), "|");
orList := string_split(field(line), "|");
// give first item from optional orList
if (len_array(orList) > 0) then begin
componentData := string_split_ints(orList[0], ":");
Expand Down Expand Up @@ -675,7 +675,7 @@ procedure draw_item_properties begin
saved_line := line;
while (field(line) != ITEM_SKILLS and line < SECTION_STEP and field(line) != "Error" and bstr(cur_section_start) == ITEM_ITEM) do begin
has_any := 0;
list := string_split_safe(field(line), "|");
list := string_split(field(line), "|");
i := 0;
foreach tool_word in list begin
tool := atoi(tool_word);
Expand Down Expand Up @@ -710,7 +710,7 @@ procedure draw_item_properties begin
// Display list of skills
saved_line := line;
while (field(line) != ITEM_COMPONENTS and line < SECTION_STEP and field(line) != "Error" and bstr(cur_section_start) == ITEM_ITEM) do begin
list := string_split_safe(field(line), ":");
list := string_split(field(line), ":");
if (len_array(list) != 2) then debug_msg("! ERROR ! [craft] Invalid skill definition: " + field(line));
skill_lv := atoi(list[1]);
// list of skills
Expand Down Expand Up @@ -753,7 +753,7 @@ procedure draw_item_properties begin
max_batch := 32767;
while (line < SECTION_STEP and field(line) != "Error" and bstr(cur_section_start) == ITEM_ITEM) do begin
has_any := 0;
list := string_split_safe(field(line), "|");
list := string_split(field(line), "|");
i := 0;
max2 := 0;
foreach tool_word in list begin
Expand Down Expand Up @@ -830,7 +830,7 @@ end

procedure parse_skill_name(variable s_name) begin
variable i, j, skill, lst, lst2, s;
lst := string_split_safe(s_name, "+");
lst := string_split(s_name, "+");
lst2 := temp_array(len_array(lst), 4);
j := 0;
foreach s in lst begin
Expand Down
3 changes: 1 addition & 2 deletions scripts_src/_pbs_headers/ecco.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@

#define is_melee_attack(type) (type == ATTACK_MODE_PUNCH or type == ATTACK_MODE_KICK or type == ATTACK_MODE_SWING or type == ATTACK_MODE_THRUST)

#define tile_behind_obj_rng(who, rng) \
(tile_num_in_direction(tile_num(who),((has_trait(1,who,10) + 3) % 6), rng))
#define tile_behind_obj_rng(who, rng) (tile_num_in_direction(tile_num(who),((has_trait(TRAIT_OBJECT,who,OBJECT_CUR_ROT) + 3) % 6), rng))

#define attacker_behind_target(oA, oT) \
((tile_distance(tile_num(oA),tile_behind_obj_rng(oT, 2))<=2) and (tile_distance_objs(oA,oT)<=2))
Expand Down
4 changes: 2 additions & 2 deletions scripts_src/_pbs_main/gl_expforkill_mod.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#include "../sfall/lib.arrays.h"
#include "../sfall/lib.math.h"

#define SCRIPT_REALNAME "gl_expforkill_mod"

#include "../_pbs_headers/ecco.h"

#define INI_SECTION "EXP_FOR_KILL"

#define debug_log(msg) debug_msg("gl_expforkill_mod: "+msg)

variable
origExpMap, // associative array pid => original exp value
killExpMap; // associative array killType => accumulated exp
Expand Down
2 changes: 1 addition & 1 deletion scripts_src/_pbs_main/gl_pbs_barter.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ procedure barterprice_handler begin
set_sfall_return(0);
end

if stats != "" then debug_log(stats+", dude barter: "+dudeBarter+", merchant barter: "+merchantBarter);
if stats != "" then debug_log(stats+", dude barter: "+dudeBarter+", merchant barter: "+merchantBarter+", barter_mod: "+dialogBarterMod);
end

procedure calc_items_demand_mod(variable containerObj) begin
Expand Down
5 changes: 3 additions & 2 deletions scripts_src/_pbs_main/gl_pbs_damage_mod.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* - Allows to override attack damage type based on loaded ammo. This affects damage calculations as well as death animations.
*/

#define SCRIPT_REALNAME "pbs_damage_mod"

#include "../sfall/lib.arrays.h"
#include "../sfall/lib.math.h"
#include "../sfall/define_lite.h"
Expand Down Expand Up @@ -44,8 +46,7 @@ procedure round_chance(variable dmg);
#define INI_DAMAGE_TYPE_SECTION "DAMAGE_TYPE"
#define INI_ATTACK_MODES_SECTION "ATTACK_MODES"

#define debug_log(msg) debug_msg("pbs_damage_mod: "+msg)
#define debug_verbose(msg) if ini_debug then debug_msg("pbs_damage_mod: "+msg)
#define debug_verbose(msg) if ini_debug then debug_log(msg)

#define DT_MODE_ADD (1)
#define DT_MODE_MULT (2)
Expand Down
9 changes: 9 additions & 0 deletions scripts_src/_pbs_main/tests/_export_array_syntax_bug.ssl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export variable wtf;

procedure start begin
variable k := "a";
wtf := temp_array(-1, 0);
wtf[k] := 1;
display_msg(wtf[k]);
end

11 changes: 9 additions & 2 deletions scripts_src/_pbs_main/tests/_if_after_foreach_bug.ssl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
procedure test(variable x) begin
return x*x;
end


procedure start begin
variable k, a, arr2;
arr2 := 111;
foreach k in (arr2)
if (k) then arr2[k] := 1;
for k := 0; k < 2; k++;
display_msg(1);

foreach (k in arr2) if (k) then arr2[k] := 1;

end
23 changes: 23 additions & 0 deletions scripts_src/_pbs_main/tests/_leftover_strings_bug.ssl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
procedure procedure1;
procedure procedure2;

variable procName;

procedure procedure1 begin
display_msg("yeees!"+procedure2+procedure1);
end

procedure procedure2 begin
display_msg("double yes 121233!"+procedure2+procedure1);
end

procedure start begin
variable localempty := "";// @procedure1;
variable localNotEmpty := "noooot";
//localNotEmpty := "noooot";
//call procedure1;
//call @procedure1;
//call "procedure1";
//call procName;
display_msg("No?" + localempty + localNotEmpty);
end
27 changes: 21 additions & 6 deletions scripts_src/_pbs_main/tests/_string_call_bug.ssl
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
procedure my_proc begin
display_msg("my_proc called");


variable cond;

procedure my_proc1(variable arg) when cond begin
display_msg("my_proc1 called: "+arg+", cond: "+cond+"; ");
end

procedure descProc begin
variable arg := get_sfall_arg;
if (arg == dude_obj) then cond := not cond;
call my_proc1(arg);
end

procedure start begin
variable n;
variable procName;
call my_proc;
n := dude_obj;
//call my_proc1(1);
//call "my_proc1"(2);
//procName := @my_proc1;
//call procName(3);
n := dude_obj != 0;
procName := "my_"+"proc"+n;
call procName;
end
call procName(4);

register_hook_proc(34, descProc);
end
6 changes: 6 additions & 0 deletions scripts_src/_pbs_main/tests/arrays_testcase.ssl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "../../sfall/sfall.h"
#include "../../sfall/lib.arrays.h"

variable test_suite_errors := 0;
variable test_suite_verbose := true;
Expand Down Expand Up @@ -152,6 +154,10 @@ procedure array_test_suite begin
display_msg("Testing save/load...");
arr := [2,1];
arr2 := {1:2};
s := "";
k := 1;
if (arr and not arr2[k]) then s := "ok";
call assertEquals("bracket syntax", "ok", s);
save_array("myarray", arr);
call assertEquals("load 1", load_array("myarray"), arr);
save_array("myarray", arr2);
Expand Down
35 changes: 29 additions & 6 deletions scripts_src/_pbs_main/tests/gl_cheat_enemyspawner.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "..\..\sfall\define_lite.h"
#include "..\..\sfall\lib.arrays.h"
#include "..\..\sfall\lib.inven.h"
#include "..\..\headers\animcomd.h"
#include "..\..\headers\critrpid.h"
#include "..\..\headers\itempid.h"
#include "..\..\headers\scripts.h"
Expand All @@ -19,6 +20,9 @@
#define ENEMY_RAT (5)
#define ENEMY_ALIEN (6)
#define ENEMY_MELEE (7)
#define ENEMY_GECKO (8)
#define ENEMY_BOSS (9)
#define ENEMY_DEATHCLAW (10)

variable enemy_types;

Expand All @@ -43,9 +47,19 @@ procedure spawn_enemy(variable type, variable tile) begin
case ENEMY_RAT:
pid := PID_RAT;
sid := SCRIPT_ZCLRAT;
case ENEMY_GECKO:
pid := PID_GOLDEN_GECKO;
sid := SCRIPT_ZCLGECKO;
case ENEMY_ALIEN:
pid := PID_ALIEN;
sid := SCRIPT_ECALIEN;
case ENEMY_BOSS:
pid := PID_END_BOSS;
sid := SCRIPT_QCFRANK;
weaponPid := 530;
case ENEMY_DEATHCLAW:
pid := PID_MOTHER_DEATHCLAW; // PID_TOUGH_DEATHCLAW;
sid := SCRIPT_ECDTHCLW;
case ENEMY_MELEE:
female := random(0, 1);
pid := PID_MELEE_GUARD_MALE + female;
Expand All @@ -59,13 +73,14 @@ procedure spawn_enemy(variable type, variable tile) begin
critter := create_object_sid(pid, tile, dude_elevation, sid);
if (weaponPid) then begin
weapon := add_item_pid(critter, weaponPid);
wield_obj_critter(critter, weapon);
//wield_obj_critter(critter, weapon);
ammoPid := get_proto_data(weaponPid, PROTO_WP_AMMO_PID);
if (ammoPid) then
if (ammoPid > 0) then
call add_items_pid(critter, ammoPid, random(1, 3));
if stimpaks then
call add_items_pid(critter, PID_STIMPAK, stimpaks);
end
return critter;
end

procedure spawn_enemies_circle(variable type, variable radius) begin
Expand All @@ -91,11 +106,19 @@ procedure keypress_handler begin
isPressed := get_sfall_arg,
keyCode := get_sfall_arg;

if isPressed and get_cursor_mode == 0 then begin
if (keyCode == DIK_5) then
if isPressed and get_cursor_mode == 0 and key_pressed(DIK_LSHIFT) then begin
//display_msg("key pressed "+keyCode);
if (keyCode == DIK_5) then begin
//call spawn_enemy(ENEMY_BOSS, tile_under_cursor);
call spawn_enemies_circle(ENEMY_ENCLAVE, 2);
if (keyCode == DIK_6) then
call spawn_enemies_line(ENEMY_MELEE, 3, 0, 1);
end
if (keyCode == DIK_6) then begin
variable crit := spawn_enemy(ENEMY_DEATHCLAW, tile_under_cursor);
reg_anim_clear(crit);
reg_anim_begin();
reg_anim_obj_move_to_obj(crit, dude_obj, -1);
reg_anim_end();
end
if (keyCode == DIK_7) then
call spawn_enemy(ENEMY_FARMER, tile_under_cursor);
if (keyCode == DIK_8) then
Expand Down
Loading

0 comments on commit 6314553

Please sign in to comment.