Browse Source

Reformat repo and add features

- Use a new custom book instead of Gwent book
- Toggle spoilers in mod menu
master
Abheek Dhawan 3 years ago
parent
commit
7776c405a5
Signed by: abheekd GPG Key ID: 7BE81B8C14475B67
  1. 4
      .woodpecker/release.yml
  2. BIN
      bin/config/r4game/user_config_matrix/pc/modStatTrak.xml
  3. BIN
      content/scripts/game/components/inventoryComponent.ws
  4. BIN
      dlc/dlcStatTrak/content/ar.w3strings
  5. BIN
      dlc/dlcStatTrak/content/blob0.bundle
  6. BIN
      dlc/dlcStatTrak/content/br.w3strings
  7. BIN
      dlc/dlcStatTrak/content/cn.w3strings
  8. BIN
      dlc/dlcStatTrak/content/cz.w3strings
  9. BIN
      dlc/dlcStatTrak/content/de.w3strings
  10. BIN
      dlc/dlcStatTrak/content/en.w3strings
  11. BIN
      dlc/dlcStatTrak/content/es.w3strings
  12. BIN
      dlc/dlcStatTrak/content/esmx.w3strings
  13. BIN
      dlc/dlcStatTrak/content/fr.w3strings
  14. BIN
      dlc/dlcStatTrak/content/hu.w3strings
  15. BIN
      dlc/dlcStatTrak/content/it.w3strings
  16. BIN
      dlc/dlcStatTrak/content/jp.w3strings
  17. BIN
      dlc/dlcStatTrak/content/kr.w3strings
  18. BIN
      dlc/dlcStatTrak/content/metadata.store
  19. BIN
      dlc/dlcStatTrak/content/pl.w3strings
  20. BIN
      dlc/dlcStatTrak/content/ru.w3strings
  21. BIN
      dlc/dlcStatTrak/content/zh.w3strings
  22. 5873
      mods/modStatTrak/content/scripts/game/components/inventoryComponent.ws
  23. 14676
      mods/modStatTrak/content/scripts/game/player/r4player.ws
  24. 10
      mods/modStatTrak/content/scripts/local/achievementStatTrak/achievement_stats.ws
  25. 8
      src/StatTrak.w3modproj
  26. BIN
      src/StatTrak/files/DLC/Bundle/dlc/StatTrak/dlcStatTrak.reddlc
  27. BIN
      src/StatTrak/files/DLC/Bundle/dlc/StatTrak/gameplay/items/def_stattrak_items.xml
  28. 5873
      src/StatTrak/files/Mod/scripts/game/components/inventoryComponent.ws
  29. 14676
      src/StatTrak/files/Mod/scripts/game/player/r4player.ws
  30. 212
      src/StatTrak/files/Mod/scripts/local/achievementStatTrak/achievement_stats.ws
  31. 8
      strings/csv/en.w3strings.csv

4
.woodpecker/release.yml

@ -2,11 +2,9 @@ pipeline:
prep-release:
image: alpine:latest
commands:
- mkdir -p modAchievementStatTrak
- mv content/ modAchievementStatTrak/
- apk update
- apk add zip
- zip -r modAchievementStatTrak.zip modAchievementStatTrak/
- zip -r StatTrak.zip {dlc,mods,bin}/
when:
event: tag

BIN
bin/config/r4game/user_config_matrix/pc/modStatTrak.xml

Binary file not shown.

BIN
content/scripts/game/components/inventoryComponent.ws

Binary file not shown.

BIN
dlc/dlcStatTrak/content/ar.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/blob0.bundle

Binary file not shown.

BIN
dlc/dlcStatTrak/content/br.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/cn.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/cz.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/de.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/en.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/es.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/esmx.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/fr.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/hu.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/it.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/jp.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/kr.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/metadata.store

Binary file not shown.

BIN
dlc/dlcStatTrak/content/pl.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/ru.w3strings

Binary file not shown.

BIN
dlc/dlcStatTrak/content/zh.w3strings

Binary file not shown.

5873
mods/modStatTrak/content/scripts/game/components/inventoryComponent.ws

File diff suppressed because it is too large

14676
mods/modStatTrak/content/scripts/game/player/r4player.ws

File diff suppressed because it is too large

10
content/scripts/local/achievementStatTrak/achievement_stats.ws → mods/modStatTrak/content/scripts/local/achievementStatTrak/achievement_stats.ws

@ -152,6 +152,16 @@ function getFormattedAchievementStats(statList : array<EStatistic>) : string
currentName = getAchievmentStatName(currentRawName);
currentVal = getAchievementStatVal(statList[i]);
// If allowing spoilers was not toggled on
if (!theGame.GetInGameConfigWrapper().GetVarValue('ModStatTrak', 'AllowSpoilers'))
{
if (currentName == "Rad Steez, Bro!" || currentName == "Moo-rderer")
{
// Don't print and continue the loop
continue;
}
}
if (i != 0)
{
achievementString += "<br><br>" + currentRawName + ": " + "<font color='#00ff00'>" + currentVal + "</font>" + "<br>" + "Achievement: " + "<font color='#0088ff'>" + currentName + "</font>";

8
src/StatTrak.w3modproj

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<W3Mod xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<LastOpenedFiles>
<string>C:\Users\abheekd\Desktop\Witcher-Wkit\Projects\StatTrak\files\DLC\Bundle\dlc\stattrak\dlcstattrak.reddlc</string>
<string>C:\Users\abheekd\Desktop\Witcher-Wkit\Projects\StatTrak\files\DLC\Bundle\dlc\StatTrak\dlcStatTrak.reddlc</string>
</LastOpenedFiles>
<Name>StatTrak</Name>
</W3Mod>

BIN
src/StatTrak/files/DLC/Bundle/dlc/StatTrak/dlcStatTrak.reddlc

Binary file not shown.

BIN
src/StatTrak/files/DLC/Bundle/dlc/StatTrak/gameplay/items/def_stattrak_items.xml

Binary file not shown.

5873
src/StatTrak/files/Mod/scripts/game/components/inventoryComponent.ws

File diff suppressed because it is too large

14676
src/StatTrak/files/Mod/scripts/game/player/r4player.ws

File diff suppressed because it is too large

212
src/StatTrak/files/Mod/scripts/local/achievementStatTrak/achievement_stats.ws

@ -0,0 +1,212 @@
// TODO: Multiple functions: one returns array of stuff, another formats, and one final exec function
// Function to get the stats in a formatted string
function getAchievementStats() : array<EStatistic>
{
// Integer to be later used in the for loop
var i : int;
// Array to store the achievement stats
var stats : array<EStatistic>;
// String where all the achievements go
var achievementString : string;
// Set achievement string empty to be later added on to
achievementString = "";
// Add all stats to the array
stats.PushBack(ES_CharmedNPCKills);
stats.PushBack(ES_AardFallKills);
stats.PushBack(ES_EnvironmentKills);
stats.PushBack(ES_CounterattackChain);
stats.PushBack(ES_DragonsDreamTriggers);
stats.PushBack(ES_KnownPotionRecipes);
stats.PushBack(ES_KnownBombRecipes);
stats.PushBack(ES_ReadBooks);
stats.PushBack(ES_HeadShotKills);
stats.PushBack(ES_BleedingBurnedPoisoned);
stats.PushBack(ES_DestroyedNests);
stats.PushBack(ES_FundamentalsFirstKills);
stats.PushBack(ES_FinesseKills);
stats.PushBack(ES_SelfArrowKills);
stats.PushBack(ES_ActivePotions);
stats.PushBack(ES_KilledCows);
stats.PushBack(ES_SlideTime);
// Return the array of stats
return stats;
}
function getAchievementStatVal(statEnum : EStatistic) : int
{
// Get value from enum
return theGame.GetGamerProfile().GetStatValue(statEnum);
}
function getAchievementStatNameRaw(statEnum : EStatistic) : string
{
// Get raw name from enum
return StatisticEnumToName(statEnum);
}
function getAchievmentStatName(rawStatName : string) : string
{
var formattedStatName : string;
// Set Steam/GOG achievement name from name
switch (rawStatName)
{
case "statistic_charmed_kills":
formattedStatName = "The Enemy of My Enemy";
break;
case "statistic_aardfall_kills":
formattedStatName = "Humpty Dumpty";
break;
case "statistic_environment_kills":
formattedStatName = "Environmentally Unfriendly";
break;
case "statistic_bleed_burn_poison":
formattedStatName = "Overkill";
break;
case "statistic_counterattack_chain":
formattedStatName = "Kaer Morhen Trained";
break;
case "statistic_burning_gas_triggers":
formattedStatName = "That Is the Evilest Thing";
break;
case "statistic_known_potions":
formattedStatName = "Let's Cook!";
break;
case "statistic_known_bombs":
formattedStatName = "Bombardier";
break;
case "statistic_head_shot_kills":
formattedStatName = "Master Marksman";
break;
case "statistic_read_books":
formattedStatName = "Bookworm";
break;
case "statistic_destroyed_nests":
formattedStatName = "Fire in the Hole";
break;
case "statistic_fundamentals_kills":
formattedStatName = ""; // Don't know what achievement this corresponds to
break;
case "statistic_finesse_kills":
formattedStatName = ""; // Don't know what achievement this corresponds to
break;
case "statistic_self_arrow_kills":
formattedStatName = "Return to Sender";
break;
case "statistic_active_potions":
formattedStatName = "Can Quit Anytime I Want";
break;
case "statistic_killed_cows":
formattedStatName = "Moo-rderer";
break;
case "statistic_slide_time":
formattedStatName = "Rad Steez, Bro!";
break;
default:
formattedStatName = "";
break;
}
// Return Steam/GOG achievement name
return formattedStatName;
}
function getFormattedAchievementStats(statList : array<EStatistic>) : string
{
// Vars for formatted string
var achievementString : string;
var currentRawName : string;
var currentName : string;
var currentVal : int;
var i : int;
achievementString = "";
// Loop through each stat to create a final string that goes in the Gwent book
for (i = 0; i < statList.Size(); i += 1)
{
// Use other functions to get data
currentRawName = getAchievementStatNameRaw(statList[i]);
currentName = getAchievmentStatName(currentRawName);
currentVal = getAchievementStatVal(statList[i]);
// If allowing spoilers was not toggled on
if (!theGame.GetInGameConfigWrapper().GetVarValue('ModStatTrak', 'AllowSpoilers'))
{
if (currentName == "Rad Steez, Bro!" || currentName == "Moo-rderer")
{
// Don't print and continue the loop
continue;
}
}
if (i != 0)
{
achievementString += "<br><br>" + currentRawName + ": " + "<font color='#00ff00'>" + currentVal + "</font>" + "<br>" + "Achievement: " + "<font color='#0088ff'>" + currentName + "</font>";
}
else
{
// Don't add beginning newline for first element
achievementString += currentRawName + ": " + "<font color='#00ff00'>" + currentVal + "</font>" + "<br>" + "Achievement: " + "<font color='#0088ff'>" + currentName + "</font>";
}
}
// Return final formatted string
return achievementString;
}
//------------------------
// EXEC FUNCTIONS
//------------------------
exec function getAllAchievementStats()
{
// Define vars for adding notification for all achievement stats
var statList : array<EStatistic>;
var formattedStats : string;
// Get data
statList = getAchievementStats();
formattedStats = getFormattedAchievementStats(statList);
// Add notification
theGame.GetGuiManager().ShowNotification(formattedStats);
}
// TODO: Fix getting a single achievement stat
/*exec function getAchievementStat(statEnum : EStatistic)
{
// Define vars for adding notification for specific stat
var rawName : string;
var achName : string;
var val : int;
// Get data
rawName = getAchievementStatNameRaw(statEnum);
achName = getAchievementStatVal(statEnum);
val = getAchievementStatVal(statEnum);
// Print to notification
theGame.GetGuiManager().ShowNotification(rawName + ": " + "<font color='#00ff00'>" + val + "</font>" + "<br>" + "Achievement: " + "<font color='#0088ff'>" + val);
}*/

8
strings/csv/en.w3strings.csv

@ -0,0 +1,8 @@
;meta[language=en]
; id |key(hex)|key(str)| text
;
; Achievement book name
2116720001| |item_name_ach_stats|StatTrak
2116720002| |option_dlc_stattrak|StatTrak
2116720003| |option_AllowSpoilers|Allow Spoilers
2116720004| |panel_ModStatTrak|StatTrak
Can't render this file because it has a wrong number of fields in line 2.
Loading…
Cancel
Save