Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Affliction "Drag" doesn't do anything

Open zhu-rengong opened this issue 1 year ago • 1 comments

Disclaimers

  • [X] I have searched the issue tracker to check if the issue has already been reported.
  • [ ] My issue happened while using mods.

What happened?

Affliction "Drag" will expect the character's movementspeed to decrease but it doesn't look into the following code:

  <Affliction
    name="Drag"
    identifier="drag"
    type="drag"
    showiconthreshold="1000"
    treatmentthreshold="1000"
    maxstrength="1"
    minspeedmultiplier="0.3"
    maxspeedmultiplier="0.3">
    <Effect minstrength="0" maxstrength="1" strengthchange="-0.6"/>
    <icon texture="Content/UI/CommandUIAtlas.png" sourcerect="768,768,128,128" color="143,111,160,255" origin="0,0"/>
  </Affliction>

  <Item name="" identifier="spear" category="Weapon" maxstacksize="32" maxstacksizecharacterinventory="6" interactthroughwalls="true" cargocontaineridentifier="metalcrate" tags="mediumitem,harpoonammo" Scale="0.5" impactsoundtag="impact_metal_light">
    <PreferredContainer primary="harpoongun" amount="6" spawnprobability="1" />
    <PreferredContainer primary="armcab" minamount="3" maxamount="6" spawnprobability="1" notcampaign="true" />
    <PreferredContainer secondary="wreckarmcab,abandonedarmcab" minamount="1" maxamount="3" spawnprobability="0.2" />
    <PreferredContainer primary="secarmcab" />
    <Price baseprice="7">
      <Price storeidentifier="merchantoutpost" minavailable="12" multiplier="1.5" />
      <Price storeidentifier="merchantcity" minavailable="12" multiplier="1.25" />
      <Price storeidentifier="merchantresearch" minavailable="6" multiplier="1.25" />
      <Price storeidentifier="merchantmilitary" minavailable="24" multiplier="0.9" />
      <Price storeidentifier="merchantmine" minavailable="6" multiplier="1.25" />
      <Price storeidentifier="merchantarmory" minavailable="24" multiplier="0.9" />
    </Price>
    <Deconstruct time="5" />
    <Fabricate suitablefabricators="fabricator" requiredtime="10" amount="6">
      <RequiredSkill identifier="weapons" level="20" />
      <RequiredItem identifier="steel" />
    </Fabricate>
    <InventoryIcon texture="Content/Items/InventoryIconAtlas.png" sourcerect="320,968,55,55" origin="0.5,0.5" />
    <Sprite texture="Content/Items/Weapons/weapons_new.png" sourcerect="85,368,168,11" depth="0.55" origin="0.5,0.5" />
    <Body width="160" height="10" density="30" />
    <Pickable slots="Any" msg="ItemMsgPickUpSelect" />
    <Rope sourcepullforce="300" targetpullforce="100" projectilepullforce="5" maxlength="1500" snaponcollision="false" spritewidth="3" tile="true" origin="0.05,0.5" targetminmass="30" lerpforces="true" snapanimduration="0.5">
      <Sprite texture="Content/Map/Thalamus/thalamus.png" sourcerect="617,352,174,32" depth="0.57" origin="0.5,0.5" />
      <!-- Snap after 1 seconds if not stuck to anything -->
      <StatusEffect type="OnUse" target="This" Snapped="true" delay="1" checkconditionalalways="true">
        <Conditional targetitemcomponent="Projectile" IsStuckToTarget="false" />
      </StatusEffect>
    </Rope>
    <Projectile characterusable="false" launchimpulse="5" sticktocharacters="true" sticktoitems="true" sticktostructures="true" sticktodoors="false">
      <Attack structuredamage="15" itemdamage="15" targetforce="20" severlimbsprobability="0.1">
        <Affliction identifier="lacerations" strength="35" />
        <Affliction identifier="bleeding" strength="35" />
        <Affliction identifier="stun" strength="0.5" />
      </Attack>
      <StatusEffect type="OnActive" target="UseTarget,This" checkconditionalalways="true" comparison="And">
        <Conditional Snapped="false" />
        <Conditional mass="lt 30" />
        <Affliction identifier="drag" strength="1" />
      </StatusEffect>
    </Projectile>
    <Upgrade gameversion="0.10.0.0" scale="0.5" />
  </Item>

Reproduction steps

  1. Enter cheat code "giveaffliction drag 100" Or shoot a spear at a character
  2. The movement speed of the target character is not affected by drag (movement speed *0.3)

Bug prevalence

Happens every now and then

Single player or multiplayer?

Happens in both single player and multiplayer

-

No response

Version

v1.2.8.0 (Winter Update hotfix 2)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

zhu-rengong avatar Feb 01 '24 17:02 zhu-rengong

Occurs because the minspeedmultiplier and maxspeedmultiplier are inside the <Affliction> line, where they should be inside the <Effect> line.

Changing from the current code

  <Affliction
    name="Drag"
    identifier="drag"
    type="drag"
    showiconthreshold="1000"
    treatmentthreshold="1000"
    maxstrength="1"
    minspeedmultiplier="0.3"
    maxspeedmultiplier="0.3">
    <Effect minstrength="0" maxstrength="1" strengthchange="-0.6"/>
    <icon texture="Content/UI/CommandUIAtlas.png" sourcerect="768,768,128,128" color="143,111,160,255" origin="0,0"/>
  </Affliction>

into

  <Affliction
    name="Drag"
    identifier="drag"
    type="drag"
    showiconthreshold="1000"
    treatmentthreshold="1000"
    maxstrength="1">
    <Effect minstrength="0" maxstrength="1"
	    minspeedmultiplier="0.3"
		maxspeedmultiplier="0.3"
		strengthchange="-0.6"/>
    <icon texture="Content/UI/CommandUIAtlas.png" sourcerect="768,768,128,128" color="143,111,160,255" origin="0,0"/>
  </Affliction>

fixes the issue

Vykn avatar Feb 03 '24 04:02 Vykn

Related to #12785 @itchyOwl

JeroonBosch avatar Mar 11 '24 15:03 JeroonBosch

Tested, seems to be working correctly. PR can be merged and closed.

Rokvach avatar Mar 25 '24 10:03 Rokvach