Add testfiles

This commit is contained in:
2025-12-19 11:38:07 +01:00
parent a0c5a5f18c
commit fff8869aff
10 changed files with 265 additions and 1 deletions

74
testfiles/Afflictions.xml Normal file
View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Afflictions>
<Affliction name="" identifier="Cozy_Fire" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="10" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="10" strengthchange="-1.0">
<ReduceAffliction type="damage" amount="0.001" />
<ReduceAffliction type="bleeding" amount="0.001" />
<ReduceAffliction type="burn" amount="0.001" />
<ReduceAffliction type="bloodloss" amount="0.001" />
</Effect>
<icon texture="%ModDir%/Placable/Cozy_Fire.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="The_Bast_Defense" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="10" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="10" strengthchange="-1.0" resistancefor="damage" minresistance="0.05" maxresistance="0.05"></Effect>
<icon texture="%ModDir%/Placable/The_Bast_Defense.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Clairvoyance" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="240" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="240" strengthchange="-1.0" resistancefor="stun" minresistance="0.15" maxresistance="0.15"></Effect>
<icon texture="%ModDir%/Placable/Clairvoyance.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Heart_Lamp" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="10" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="10" strengthchange="-1.0">
<ReduceAffliction type="damage" amount="0.001" />
<ReduceAffliction type="bleeding" amount="0.001" />
<ReduceAffliction type="burn" amount="0.001" />
<ReduceAffliction type="bloodloss" amount="0.001" />
</Effect>
<icon texture="%ModDir%/Placable/Heart_Lamp.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Star_in_a_Bottle_buff" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="10" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="10" strengthchange="-1.0" resistancefor="stun" minresistance="0.1" maxresistance="0.1"></Effect>
<icon texture="%ModDir%/Placable/Star_in_a_Bottle_buff.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="HappyF" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="10" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="10" strengthchange="-1.0" resistancefor="stun" minresistance="0.05" maxresistance="0.05" minspeedmultiplier="1.1" maxspeedmultiplier="1.1"></Effect>
<icon texture="%ModDir%/Placable/Happy.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="SharpenedF" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="240" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="240" strengthchange="-1.0">
<StatValue stattype="MeleeAttackMultiplier" value="0.25" />
</Effect>
<icon texture="%ModDir%/Placable/Sharpened.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Sugar_RushF" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="240" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="240" strengthchange="-1.0" minspeedmultiplier="1.2" maxspeedmultiplier="1.2">
<StatValue stattype="MeleeAttackSpeed" value="0.05" />
<StatValue stattype="RangedAttackSpeed" value="0.05" />
</Effect>
<icon texture="%ModDir%/Placable/Sugar_Rush.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Crimson_Effigy_buff" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="240" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="240" strengthchange="-1.0" resistancefor="damage" minresistance="-0.1" maxresistance="-0.1">
<StatValue stattype="MeleeAttackSpeed" value="0.15" />
<StatValue stattype="RangedAttackSpeed" value="0.15" />
</Effect>
<icon texture="%ModDir%/Placable/Crimson_Effigy_buff.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Corruption_Effigy_buff" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="240" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="240" strengthchange="-1.0" minvitalitydecrease="0.2" multiplybymaxvitality="true" maxvitalitydecrease="0.2" resistancefor="damage" minresistance="0.1" maxresistance="0.1">
<StatValue stattype="AttackMultiplier" value="0.2" />
</Effect>
<icon texture="%ModDir%/Placable/Corruption_Effigy_buff.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Effigy_of_Decay_buff" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="240" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="240" strengthchange="-1.0" resistancefor="oxygenlow" minresistance="1" maxresistance="1">
<StatusEffect target="Character" SpeedMultiplier="1.1" OxygenAvailable="1000.0" setvalue="true" />
<AbilityFlag flagtype="ImmuneToPressure" />
</Effect>
<icon texture="%ModDir%/Placable/Effigy_of_Decay_buff.png" sourcerect="0,0,64,64" origin="0,0" />
</Affliction>
<Affliction name="" identifier="Chlorophyte_Extractinator" type="strengthbuff" limbspecific="false" isbuff="true" maxstrength="6" hideiconafterdelay="true">
<Effect minstrength="0" maxstrength="6" strengthchange="-1.0"></Effect>
<icon texture="%ModDir%/Extractinator/Chlorophyte_Extractinator.png" sourcerect="0,0,144,152" origin="0,0" />
</Affliction>
</Afflictions>

View File

@@ -0,0 +1,8 @@
- name: "JSONFormattingTest"
json: true
lua: |
data.version = "2.0.0"
data.enabled = true
data.settings.timeout = 60
return true
files: ["testfiles/test3.json"]

View File

@@ -0,0 +1,15 @@
# Test with global JSON flag (no json: true in commands)
- name: "JSONArrayMultiply"
lua: |
for i, item in ipairs(data.items) do
data.items[i].value = item.value * 2
end
return true
files: ["testfiles/test2.json"]
- name: "JSONObjectUpdate"
lua: |
data.version = "3.0.0"
data.enabled = false
return true
files: ["testfiles/test2.json"]

View File

@@ -0,0 +1,32 @@
# Global modifiers
- modifiers:
multiply: 2.0
new_version: "2.0.0"
# JSON mode examples
- name: "JSONArrayMultiply"
json: true
lua: |
for i, item in ipairs(data.items) do
data.items[i].value = item.value * $multiply
end
return true
files: ["testfiles/test.json"]
- name: "JSONObjectUpdate"
json: true
lua: |
data.version = $new_version
data.enabled = true
return true
files: ["testfiles/test.json"]
- name: "JSONNestedModify"
json: true
lua: |
if data.settings and data.settings.performance then
data.settings.performance.multiplier = data.settings.performance.multiplier * 1.5
data.settings.performance.enabled = true
end
return true
files: ["testfiles/test.json"]

30
testfiles/test.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "test-config",
"version": "1.0.0",
"enabled": false,
"settings": {
"timeout": 30,
"retries": 3,
"performance": {
"multiplier": 1.0,
"enabled": false
}
},
"items": [
{
"id": 1,
"name": "item1",
"value": 10
},
{
"id": 2,
"name": "item2",
"value": 20
},
{
"id": 3,
"name": "item3",
"value": 30
}
]
}

30
testfiles/test2.json Normal file
View File

@@ -0,0 +1,30 @@
{
"enabled": false,
"items": [
{
"id": 1,
"name": "item1",
"value": 80
},
{
"id": 2,
"name": "item2",
"value": 160
},
{
"id": 3,
"name": "item3",
"value": 240
}
],
"name": "test-config",
"settings": {
"performance": {
"enabled": true,
"multiplier": 1.5
},
"retries": 3,
"timeout": 30
},
"version": "3.0.0"
}

25
testfiles/test3.json Normal file
View File

@@ -0,0 +1,25 @@
{
"enabled": true,
"items": [
{
"id": 1,
"name": "item1",
"value": 10
},
{
"id": 2,
"name": "item2",
"value": 20
}
],
"name": "test-config",
"settings": {
"performance": {
"enabled": false,
"multiplier": 1
},
"retries": 3,
"timeout": 60
},
"version": "2.0.0"
}

View File

@@ -0,0 +1,25 @@
{
"enabled": true,
"items": [
{
"id": 1,
"name": "item1",
"value": 10
},
{
"id": 2,
"name": "item2",
"value": 20
}
],
"name": "test-config",
"settings": {
"performance": {
"enabled": false,
"multiplier": 1
},
"retries": 3,
"timeout": 60
},
"version": "2.0.0"
}

25
testfiles/test4.json Normal file
View File

@@ -0,0 +1,25 @@
{
"name": "test-config",
"version": "1.0.0",
"enabled": false,
"settings": {
"timeout": 30,
"retries": 3,
"performance": {
"multiplier": 1.0,
"enabled": false
}
},
"items": [
{
"id": 1,
"name": "item1",
"value": 10
},
{
"id": 2,
"name": "item2",
"value": 20
}
]
}