extended: scripts: selectUnitSprite: - offset: -2 code: | var int drawingRoutine; var int deathFrames; if or eq blit_part blit_torso eq blit_part blit_legs ; var ptr RuleArmor armor; unit.getRuleArmor armor; armor.getDrawingRoutine drawingRoutine; armor.getDeathFrames deathFrames; if and eq drawingRoutine 0 gt sprite_index 264 #bigger than first death frame gt deathFrames 3 ; sub deathFrames 3; add sprite_index deathFrames; end; end; return sprite_index;
Item move cost, new feature I added, you can make that item will cost 1000 TU to move from inventory.
Doesn't inventoryMoveCost already accomplish the same thing?
extended: scripts: detectUfoFromBase: - offset: 10 code: | var int maxDistanceHK; var int radarRangeHK; var int hunter; ufo.Stats.getRadarRange radarRangeHK; set maxDistanceHK radar_max_distance; add maxDistanceHK 300; add maxDistanceHK radarRangeHK; ufo.isHunting hunter; if and eq hunter 1 lt distance maxDistanceHK; var int temp_chanc 30; if gt temp_chanc detection_chance; set detection_chance temp_chanc; end; end; return detection_type detection_chance;
extended: tags: RuleUfo: PUBLIC_HYPERWAVE_DATA: int scripts: detectUfoFromBase: - offset: 10 code: | var int showHwData; ufo.getTag showHwData Tag.PUBLIC_HYPERWAVE_DATA; if eq showHwData 1; var int temp DETECTION_HYPERWAVE; bit_xor temp DETECTION_RADAR; # remove from HW radar detection bit, it leave only HW data flag bit_or detection_type temp; # add only HW falag to detection end; return detection_type detection_chance;ufos: - type: STR_SMALL_SCOUT tags: PUBLIC_HYPERWAVE_DATA: 1
tags: RuleItem: ACTIVE_IN: int # Flag Enum # 0 = always active/NA? # 1 = L. Hand # 2 = R. Hand # 4 = Belt # 8 = R. Legt # 16 = L. Leg # 32 = R. Shoulder # 64 = L. Shoulder # 128 = Backpack # 256 = Quick Draw # 512 = Worn # 1024 = Jewlery # 2048 = Hat # 3 = R & L hands # 4095 = everywherescripts: newTurnItem: - override: ITEM_RESISTANCE_SCRIPT offset: 2 code: | var ptr RuleItem itemRuleset; var int activeInEnum; item.getRuleItem itemRuleset; itemRuleset.getTag activeInEnum Tag.ACTIVE_IN; # activeInEnum has a value so we need to test it. if neq activeInEnum 0; var ptr RuleInventory itemInventory; var text inventoryId; var int testMask; item.getSlot itemInventory; itemInventory.getId inventoryId; # build a bitmask to test based on where we know the item is: if eq inventoryId "STR_LEFT_HAND"; set testMask 1; end; if eq inventoryId "STR_RIGHT_HAND"; set testMask 2; end; if eq inventoryId "STR_BELT"; set testMask 4; end; if eq inventoryId "STR_RIGHT_LEG"; set testMask 8; end; if eq inventoryId "STR_LEFT_LEG"; set testMask 16; end; if eq inventoryId "STR_RIGHT_SHOULDER"; set testMask 32; end; if eq inventoryId "STR_LEFT_SHOULDER"; set testMask 64; end; if eq inventoryId "STR_BACK_PACK"; set testMask 128; end; if eq inventoryId "STR_QD_SLOT"; set testMask 256; end; if eq inventoryId "STR_WEAR"; set testMask 512; end; if eq inventoryId "STR_WEAR_JEWELRY"; set testMask 1024; end; if eq inventoryId "STR_WEAR_HAT"; set testMask 2048; end; bit_and testMask activeInEnum; if eq testMask 0; debug_log "Item:" item " passed no tests:" testMask "enum:" activeInEnum; return; end; debug_log "Item:" item "passed the tests!:" testMask "enum:" activeInEnum; end; # script proceeds normally from here.