Starward Rogue:XML - Modifier Definitions

From Arcen Wiki
Revision as of 23:14, 6 March 2017 by Dominus Arbitrationis (talk | contribs) (We don't need a link at the bottom. Categories fill that role.)
Jump to navigation Jump to search

Overview

Tons of stuff in the game can have modifiers that apply either to itself or to shots spawned by it or to its parent entity, etc. In XML, these are always sub-nodes and never top-level nodes on their own right, or in attributes.

An example of a modifier

<system name="GoldenBatBlueTriple"
	category="Weapon"
	shot_type="BulletPointedYellow"
	damage_type="Ballistic"
	attack_power="2" fire_rate=".2"
	range_actual="2000"
	shots_per_salvo="1" shot_speed="2"
	targeting_logic="Direct" firing_timing="AllTheTime"
	image_name="GoldenBatTurret" special_bullet_patterns="BlueTriple"
>
	<modifier target="MyShots" type="RicochetsOffTerrain"/>
</system>

Specifically, this line:

<modifier target="MyShots" type="RicochetsOffTerrain"/>

Says "apply the 'RicochetsOffTerrain' modifier to shots fired from the GoldenBatBlueTriple system".

Another example

<entity name="SmallEnemy"
	category="Ship"
	display_name="Small Test Enemy"
	behavior="Attacker"
	speed="100"
	max_health="100"
>
	<system type="TestWeapon" offset="20,10" />
	<hitbox radius="32" />
	<periodic_movement_mode type="Reposition" related_point="10,5">
		<modifier type="MovementSpeed" math="Set" magnitude="1000" />
	</periodic_movement_mode>
</entity>

Specifically, this line:

<modifier type="MovementSpeed" math="Set" magnitude="1000" />

Says "when SmallEnemy switches to its Reposition mode, its movement speed is set to 1000 for the duration of that mode".

Attributes of the modifier Node

  • type (EntityModifierType)
    • The hardcoded effect to use.
  • target (string)
    • Most contexts where you can put a modifier tag have more than one possible target for the modifiers, and target is how you specify which. The valid values of this vary from context to context, detailed later.
  • duration (float or special string, optional)
    • If left blank or set to zero or a negative number, the effect lasts forever (in the case of the player entity, the effect is removed when they leave the dungeon; no persisting effects between runs)
    • If set to a positive number, the effect lasts for that many seconds and then disappears
    • this may not mean much for some contexts, where the modifier is on a concept rather than on a specific entity or whatever; if you find that an effect is not elapsing when you want it to, let us know and we'll try to work out what's going on
    • If set to "room", lasts until the player leaves the room. If set on a non-player this acts like infinite duration.
    • If set to "floor", lasts until the player leaves the floor. If set on a non-player this acts like infinite duration.
    • If set to "UntilWoken", lasts until the entity is hit by something or until the player gets within wake_range AND is in line of sight
    • math (MathType, required for some types, required to not be present for others)
  • magnitude (float, required for some types, required to not be present for others)

related_item (InventoryItemType, optional)

    • Right now only used for InventoryChangePerSecond, to specify which inventory item to affect.
  • requires_difficulty_at_least (DifficultyType, optional)
    • If the difficulty is set lower than the specified one, this modifier has no impact on the game.
  • requires_difficulty_at_most (DifficultyType, optional)
    • If the difficulty is set higher than the specified one, this modifier has no impact on the game
  • chance_out_of_100_to_copy (int, optional)
    • when copying this to an entity (for instance, when shots that apply a debuff to the things they hit), and this is > 0 and <= 100, there's only an X% chance that the modifier will actually be copied
  • damage_type (DamageType, required by things that require it)
    • only required by DamagePerSecond, for now
  • particle (particle_pattern, optional)
    • for modifiers actually on the entity's Modifiers list (so it was actually copied to it, not just applying due to some other rule), these are played during EmitOnMovementParticleEffects
    • this logic cannot result in the same NonSimEffectSpawningProfile playing more than once for that entity that frame from modifiers
  • do_not_stack (bool, optional)
    • only causes it to not-stack with other modifiers with the do_not_stack flag
    • if an effect is being copied to an entity, and that entity has another modifier of the same type (and related damage type, etc), and with this flag, then if this modifier has >= the duration and >= the magnitude it will replace the other modifier, otherwise it won't copy over
  • probation_type (EntityModifierProbationType)
    • if this is a modifier that has been copied to the player or a player system, and the probation type is violated, this modifier is immediately removed
    • if you have any probationary buffs, they're listed below the top HUD numbers
  • probation_ends_at_room_change (bool), probation_ends_at_floor_change (bool)
    • if this is a modifier that has been copied to the player or a player system, and the end condition (leave room or leave floor) is met, this modifier's probation_type is removed, rendering it permanent (unless you set duration, which will work normally)
  • disabled_during_probation (bool)
    • the modifier doesn't actually impact any math while on probation, but when probation is lifted it will apply normally
  • related_system (system)
    • used by TemporarilyGrantSystem
  • related_entity (entity)
    • usage depends on modifier type
  • related_item_pool (ItemPool)
    • usage depends on modifier type
  • conditions (List<ConditionType>)
    • if any of these conditions is not true at the time the modifier is checked, the modifier does not apply
  • related_item_pool_2 (ItemPool)
    • usage depends on effect type
  • related_ship_category (ShipCategory), related_ship_category_2 (ShipCategory)
    • usage depends on effect type
  • probation_magnitude (int)
    • used by some probations, usage depends on probation type
  • count_as_coming_from (entity)
    • this is just for record keeping; if this modifier has a probation that is successfully completed, the current save file will remember (entity) in a list

Sub-nodes: effect

Contexts In Which You Can Use A Modifier Tag

GameEntity

Valid targets:

  • MyShots
    • Shots generated by my systems.
  • OnPickupGrantToPlayer
    • Only makes sense for ItemPickup entities. When this entity is picked up by the player it puts these modifiers on the player.
  • OnPickupGrantToPlayer_FirstSystem
    • Only makes sense for ItemPickup entities. When this entity is picked up by the player it puts these modifiers on the player's first main gun.
  • OnPickupGrantToPlayer_SecondSystem
    • Only makes sense for ItemPickup entities. When this entity is picked up by the player it puts these modifiers on the player's second main gun.
  • OnPickupGrantToPlayer_MissileSystem
    • Only makes sense for ItemPickup entities. When this entity is picked up by the player it puts these modifiers on the player's missile system.
  • Self
    • Whenever an entity of this type is created (whether it's a ship being seeded or a shot being spawned), these modifiers are copied to that new entity.

periodic_movement_mode

Don't specify a target for these, there's only one: applies to the entity in the mode, while the mode lasts.

EntitySystem

Valid targets:

  • Self
    • Whenever a system of this type is created, this modifier is copied to it.
  • MyShots
    • Shots generated by this system.
  • MyParentEntity
    • The entity carrying this system. Useful for an energy-based or consumable system picked up from an ItemPickup; if you want to make something that drains energy to increase your movement speed or whatever.
  • EntitiesMyShotsHit
    • whenever a shot spawned by this system hits a ship, it copies all its modifiers with this target to that ship
  • OnUse_ParentEntity
    • whenever this system is used, these modifiers are copied to the parent entity
  • OnUse_ParentEntityFutureShots
    • whenever this system is used, these modifiers are copied to a special list on the parent entity where they don't modify the entity, but will be copied to any shots that entity produces afterward, until the duration of this modifier expires
  • MyParentEntityMainGunShots
    • whenever the ship fires its main guns, and this system is not disabled, these modifiers are copied to the emitted shots
  • NearbyEntities
    • see distance_threshold_modifiers_applied_to_nearby_entities
  • EntitiesHitByMyParentEntityMainGunShots
    • copied to any entity hit by a shot from my parent entity's main guns
      • this is checked when the shot is hit, so if you pick up (or toggle on) this system after firing but before the shots hit these modifiers will apply, and if you drop (or toggle off) this system after firing but before the shots hit these modifiers will not apply

bullet (inside bullet_pattern)

Valid targets:

  • Self
    • Applies to any shots using this bullet tag's data.