Skip to content

Commit

Permalink
Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Trylobot committed Nov 22, 2015
1 parent 57d4178 commit bf774a9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/TData.type.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Type TData
unassign_weapon_from_slot( weapon_slot.id )
EndIf
ElseIf Not weapon_slot.is_visible_to_variant()
'Ensure that any SYSTEM and LAUNCH_BAY slots are not referenced at all
'Ensure that SYSTEM, DECORATIVE and LAUNCH_BAY slots never appear in the variant data
unassign_weapon_from_slot( weapon_slot.id )
EndIf
Next
Expand Down
7 changes: 5 additions & 2 deletions src/TModalSetVariant.type.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ Type TModalSetVariant Extends TSubroutine
For g = 0 Until data.variant.weaponGroups.length
group = data.variant.weaponGroups[g]
For weapon_slot_id = EachIn group.weapons.Keys()
all_assigned_weapon_slot_ids.Insert( weapon_slot_id, String( group.weapons.ValueForKey( weapon_slot_id )) )
count :+ 1
'Local weapon_slot:TStarfarerShipWeapon = data.find_weapon_slot_by_id( weapon_slot_id )
'If weapon_slot And weapon_slot.is_visible_to_variant()
all_assigned_weapon_slot_ids.Insert( weapon_slot_id, String( group.weapons.ValueForKey( weapon_slot_id )) )
count :+ 1
'EndIf
Next
Next
weapon_slot_ids = new String[count]
Expand Down
9 changes: 7 additions & 2 deletions src/TStarfarerShipWeapon.type.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ Type TStarfarerShipWeapon
EndMethod
'derived field
Method is_builtin%()
Return (type_ = "BUILT_IN" Or type_ = "DECORATIVE")
Return (type_ = "BUILT_IN")
EndMethod
'derived field
Method is_system%()
Return (type_ = "SYSTEM")
EndMethod
'derived field
Method is_decorative%()
Return (type_ = "DECORATIVE")
EndMethod
'derived field
Method is_visible_to_variant%()
Return Not is_launch_bay() ..
And Not is_system()
And Not is_system() ..
And Not is_decorative()
EndMethod

Method New()
Expand Down
10 changes: 9 additions & 1 deletion src/TStarfarerSkin.type.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,39 @@ Type TStarfarerSkin
Field hullName$
Field descriptionId$
Field descriptionPrefix$
Field fleetPoints%
Field ordnancePoints%
Field systemId$
Field baseValueMult#
Field removeHints$[]
Field addHints$[]
Field spriteName$
Field removeWeaponSlots$[]' weapon slot id's
Field removeEngineSlots%[]' engine slot indices (no id's)
Field removeBuiltInMods$[]' hullmod ids
Field removeBuiltInWeapons$[]' weapon slot id's
Field builtInMods$[]' hullmod ids
Field builtInWeapons:TMap'<String,String> weapon slot id --> weapon id
Field weaponSlotChanges:TMap'<String,TStarfarerShipWeapon> weapon slot id --> TStarfarerShipWeapon

Method New()
baseHullId = "base_hull"
skinHullId = "skin_hull"
hullName = "Skin Hull"
descriptionId = "base_hull"
descriptionPrefix = ""
ordnancePoints = 0
baseValueMult = 1
systemId = ""
spriteName = "graphics/ships/new_hull.png"
removeHints = New String[0]
addHints = New String[0]
removeWeaponSlots = New String[0]
removeEngineSlots = New Int[0]
removeBuiltInMods = New String[0]
removeBuiltInWeapons = New String[0]
builtInMods = New String[0]
builtInWeapons = CreateMap()
weaponSlotChanges = CreateMap()
End Method

End Type
Expand Down

0 comments on commit bf774a9

Please sign in to comment.