Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for X4 7.0 Beta #15

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion aiscripts/betterpiracy.order.fight.corsair.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@
<match_context macro="this.sector.macro" />
<match class="$targetclasses" />
<match_distance object="this.ship" max="$radius" />
<match_relation_of faction="this.trueowner" comparison="lt" relation="neutral" />
<match_any>
<!-- either hostile factions or with SCA paintmod (makes more sense than knowing true owner) -->
<match_relation_of faction="this.trueowner" comparison="lt" relation="neutral" />
<match_paint_mod ware="paintmod_0005" />
</match_any>
<match trueowner="[this.trueowner, faction.ownerless]" negate="true" />
</count_gravidar_contacts>
<check_any exact="$detected.count" counter="$i">
Expand Down
69 changes: 35 additions & 34 deletions aiscripts/betterpiracy.order.fight.harass.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,91 +3,92 @@
<!-- To properly function, this order will need information available from the harass md script. order triggered via creation of a harass operation. -->
<order id="Harass" name="{61537, 5050}" description="{61537, 5051}" category="internal">
<params>
<param name="target" required="true" type="object" text="{1041, 10126}" comment="Target. The object to harass" />
<param name="harassoperation" default="null" type="internal" comment="Harass operation. Harass operation this ship is a part of" />
<param name="target" required="true" type="object" text="{1041, 10126}" comment="Target. The object to harass"/>
<param name="harassoperation" default="null" type="internal" comment="Harass operation. Harass operation this ship is a part of"/>
</params>
<requires>
<match shiptype="shiptype.lasertower" negate="true" />
<match shiptype="shiptype.lasertower" negate="true"/>
</requires>
<location condition="$target.isoperational" object="$target" />
<location condition="$target.isoperational" object="$target"/>
</order>
<interrupts>
<handler ref="SectorChangeHandler" />
<handler ref="TargetInvalidHandler" />
<handler ref="MissileLockHandler" />
<handler ref="SectorChangeHandler"/>
<handler ref="TargetInvalidHandler"/>
<handler ref="MissileLockHandler"/>
<handler comment="Attack target event handler">
<conditions>
<check_all>
<event_object_signalled object="$target" param="$harassoperation" param2="'harass__attack'" />
<event_object_signalled object="$target" param="$harassoperation" param2="'harass__attack'"/>
<check_value value="$activebehavior != 'attack'"/>
</check_all>
</conditions>
<actions>
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) received an -Attack- signal from harass operation %s.'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation]" />
<abort_called_scripts resume="attack" />
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) received an -Attack- signal from harass operation %s.'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation]"/>
<abort_called_scripts resume="attack"/>
</actions>
</handler>
<handler comment="Chase target event handler">
<conditions>
<check_all>
<event_object_signalled object="$target" param="$harassoperation" param2="'harass__chase'" />
<event_object_signalled object="$target" param="$harassoperation" param2="'harass__chase'"/>
<check_value value="$activebehavior != 'chase'"/>
</check_all>
</conditions>
<actions>
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) received a -Chase- signal from harass operation %s.'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation]" />
<abort_called_scripts resume="chase" />
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) received a -Chase- signal from harass operation %s.'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation]"/>
<abort_called_scripts resume="chase"/>
</actions>
</handler>
<handler comment="End event handler">
<conditions>
<event_object_signalled object="$target" param="$harassoperation" param2="'harass__end'" />
<event_object_signalled object="$target" param="$harassoperation" param2="'harass__end'"/>
</conditions>
<actions>
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) received an -End- signal from harass operation %s.'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation]" />
<abort_called_scripts resume="end" />
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) received an -End- signal from harass operation %s.'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation]"/>
<abort_called_scripts resume="end"/>
</actions>
</handler>
</interrupts>
<init>
<set_value name="$activebehavior" exact="'none'"/>
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) initializing harass operation %s against: %s (%s).'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation, $target.knownname, $target.idcode]" />
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) initializing harass operation %s against: %s (%s).'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation, $target.knownname, $target.idcode]"/>
</init>
<attention min="unknown">
<actions>
<!-- Attack action: Attack the target -->
<label name="attack" />
<label name="attack"/>
<set_value name="$activebehavior" exact="'attack'"/>
<run_script name="'order.fight.attack.object'">
<param name="primarytarget" value="$target" />
<param name="allowothertargets" value="false" />
<param name="primarytarget" value="$target"/>
<param name="allowothertargets" value="false"/>
</run_script>
<resume label="attack" />

<resume label="attack"/>
<!-- Chase action: Close-in but do NOT attack -->
<label name="chase" />
<label name="chase"/>
<set_value name="$activebehavior" exact="'chase'"/>
<cease_fire object="this.ship" />
<do_if value="this.ship.isclass.[class.ship_l, class.ship_xl] and this.ship.defencenpc.exists">
<cease_fire object="this.ship"/>
<do_if value="this.ship.defencenpc.exists">
<signal_objects object="this.ship.defencenpc" param="'stop attack'"/>
</do_if>
<run_script name="'move.generic'">
<param name="destination" value="$target" />
<param name="destination" value="$target"/>
</run_script>
<wait exact="2s" />
<resume label="chase" />

<wait exact="2s"/>
<resume label="chase"/>
<!-- End action: CleanUp and finish -->
<label name="end"/>
<cease_fire object="this.ship" />
<do_if value="this.ship.isclass.[class.ship_l, class.ship_xl] and this.ship.defencenpc.exists">
<cease_fire object="this.ship"/>
<do_if value="this.ship.defencenpc.exists">
<signal_objects object="this.ship.defencenpc" param="'stop attack'"/>
</do_if>
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) ending harass operation %s against: %s (%s).'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation, $target.knownname, $target.idcode]" />
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) ending harass operation %s against: %s (%s).'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation, $target.knownname, $target.idcode]"/>
</actions>
</attention>
<on_abort>
<cease_fire object="this.ship" />
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) aborting harass operation %s against: %s (%s).'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation, $target.knownname, $target.idcode]" />
<cease_fire object="this.ship"/>
<do_if value="this.ship.defencenpc.exists">
<signal_objects object="this.ship.defencenpc" param="'stop attack'"/>
</do_if>
<debug_to_file name="'BetterPiracy'" text="'%s --- betterpiracy.order.fight.harass --- %s (%s) aborting harass operation %s against: %s (%s).'.[player.age, this.assignedcontrolled.knownname, this.assignedcontrolled.idcode, $harassoperation, $target.knownname, $target.idcode]"/>
</on_abort>
</aiscript>
6 changes: 3 additions & 3 deletions aiscripts/move.claim.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<diff>
<!-- Remove all the hull and component damage caused by "Marine claiming" -->
<!-- This selector matches lines 106 and 207 -->
<remove sel="/aiscript/attention[@min='unknown']/actions/do_if[@value='this.ship == $target']/do_if[@value='$damagemaxpercent lt 100']"/>
<remove sel="/aiscript/attention[@min='visible']/actions/do_if[@value='this.ship == $target']/do_if[@value='$damagemaxpercent lt 100']"/>
<!-- This selector matches lines 117 and 224 -->
<remove sel="/aiscript/attention[@min='unknown']/actions/do_if[@value='this.ship == $target']/do_if[@value='$damagemaxpercent gt 0']"/>
<remove sel="/aiscript/attention[@min='visible']/actions/do_if[@value='this.ship == $target']/do_if[@value='$damagemaxpercent gt 0']"/>

<!-- Avoid having marines looping arround the target -->
<!-- This selector matches lines 31 -->
Expand Down
11 changes: 0 additions & 11 deletions aiscripts/move.flee.dock.xml

This file was deleted.

50 changes: 25 additions & 25 deletions md/betterpiracy_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
<set_value
name="Config.$Config"
exact="table[
$harass_shield_threshold = null,
$early_harass_hull_threshold = null,
$harass_bail_attemps_before_mid = null,
$mid_harass_hull_threshold = null,
$harass_bail_attemps_before_late = null,
$late_harass_hull_threshold = null,
$keep_pressure_timer = null,
$keep_pressure_max_distance_sm = null,
$keep_pressure_max_distance_lxl = null,
$pressure_buildup_rate = null,
$harass_lxl_min_crew_left_base = null,
$harass_lxl_min_crew_left_pilot = null,
$harass_base_bail_chance = null,
$harass_base_bail_number = null,
$harass_reputation_hit = null,
$harass_bailing_pilots_damage_hull = null,
$harass_bailing_pilots_destroy_components = null,
$combat_base_bail_chance = null,
$combat_reputation_hit = null,
$combat_bailing_pilots_damage_hull = null,
$combat_bailing_pilots_destroy_components = null
$harass_shield_threshold = 20,
$early_harass_hull_threshold = 75,
$harass_bail_attemps_before_mid = 3,
$mid_harass_hull_threshold = 50,
$harass_bail_attemps_before_late = 6,
$late_harass_hull_threshold = 25,
$keep_pressure_timer = 10,
$keep_pressure_max_distance_sm = 3,
$keep_pressure_max_distance_lxl = 6,
$pressure_buildup_rate = 1,
$harass_lxl_min_crew_left_base = 25,
$harass_lxl_min_crew_left_pilot = 25,
$harass_base_bail_chance = 60,
$harass_base_bail_number = 20,
$harass_reputation_hit = 1,
$harass_bailing_pilots_damage_hull = 0,
$harass_bailing_pilots_destroy_components = 0,
$combat_base_bail_chance = 36,
$combat_reputation_hit = 1,
$combat_bailing_pilots_damage_hull = 0,
$combat_bailing_pilots_destroy_components = 0
]"
/>
</actions>
Expand All @@ -52,7 +52,7 @@
$mouseover = {61537, 5152},
$type = 'slidercell',
$default = 20,
$args = table[$min = 0, $max = 100, $suffix = '%'],
$args = table[$min = 11, $max = 100, $suffix = '%'],
$callback = OnChange
]"
/>
Expand All @@ -65,7 +65,7 @@
$mouseover = {61537, 5154},
$type = 'slidercell',
$default = 75,
$args = table[$min = 0, $max = 100, $suffix = '%'],
$args = table[$min = 1, $max = 100, $suffix = '%'],
$callback = OnChange
]"
/>
Expand All @@ -91,7 +91,7 @@
$mouseover = {61537, 5158},
$type = 'slidercell',
$default = 50,
$args = table[$min = 0, $max = 100, $suffix = '%'],
$args = table[$min = 1, $max = 100, $suffix = '%'],
$callback = OnChange
]"
/>
Expand All @@ -117,7 +117,7 @@
$mouseover = {61537, 5162},
$type = 'slidercell',
$default = 25,
$args = table[$min = 0, $max = 100, $suffix = '%'],
$args = table[$min = 1, $max = 100, $suffix = '%'],
$callback = OnChange
]"
/>
Expand Down
Loading