Adding modding folder with a hacked build.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var ammoClipGenerics = interpreters.New().
|
||||
Refining("BasicWeapon", 0, 8, basicWeapon, interpreters.Always).
|
||||
With("CartrigeSize", 8, 1).
|
||||
With("BulletMass", 9, 1).
|
||||
With("BulletSpeed", 10, 2).As(interpreters.RangedValue(-10000, +10000)).
|
||||
With("Range", 12, 1).
|
||||
With("RecoilForce", 13, 1)
|
||||
|
||||
func initAmmo() {
|
||||
objClass := object.Class(1)
|
||||
|
||||
genericDescriptions[objClass] = ammoClipGenerics
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var animationGenerics = interpreters.New().
|
||||
With("FrameTime", 0, 1).As(interpreters.FormattedRangedValue(0, 255,
|
||||
func(value int) string {
|
||||
return fmt.Sprintf("%3.0f millisec", (float64(value)*900)/255.0)
|
||||
})).
|
||||
With("Flags", 1, 1).As(interpreters.Bitfield(map[uint32]string{0x01: "Emit Light"}))
|
||||
|
||||
var explosionAnimation = interpreters.New().
|
||||
With("FrameExplode", 0, 1)
|
||||
|
||||
func initAnimating() {
|
||||
objClass := object.Class(11)
|
||||
|
||||
genericDescriptions[objClass] = animationGenerics
|
||||
|
||||
setSpecific(objClass, 2, explosionAnimation)
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var critterAttackInfo = interpreters.New().
|
||||
With("DamageType", 0x0000, 1).As(damageType).
|
||||
With("SpecialDamageType", 0x0001, 1).As(specialDamageType).
|
||||
With("DamageModifier", 0x0004, 2).As(interpreters.RangedValue(0, 500)).
|
||||
With("OffenceValue", 0x0006, 1).
|
||||
With("Penetration", 0x0007, 1).
|
||||
With("AttackMass", 0x0008, 1).
|
||||
With("AttackVelocity", 0x0009, 2).
|
||||
With("Accuracy", 0x000B, 1).
|
||||
With("AttackRange", 0x000C, 1).
|
||||
With("ReloadTime", 0x000D, 2).As(interpreters.RangedValue(0, 1000)).
|
||||
With("Projectile", 0x0011, 4).As(interpreters.SpecialValue("ObjectTriple"))
|
||||
|
||||
var critterGenerics = interpreters.New().
|
||||
Refining("PrimaryAttack", 0x0001, 21, critterAttackInfo, interpreters.Always).
|
||||
Refining("SecondaryAttack", 0x0016, 21, critterAttackInfo, interpreters.Always).
|
||||
With("Perception", 0x002B, 1).
|
||||
With("Defence", 0x002C, 1).
|
||||
With("ProjectileSourceHeightOffset", 0x002D, 1).As(interpreters.RangedValue(-128, 127)).
|
||||
With("Flags", 0x002E, 1).As(interpreters.Bitfield(map[uint32]string{
|
||||
0x01: "Flying"})).
|
||||
With("AnimationSpeed", 0x003B, 1).
|
||||
With("AttackSoundIndex", 0x003C, 1).
|
||||
With("NearSoundIndex", 0x003D, 1).
|
||||
With("HurtSoundIndex", 0x003E, 1).
|
||||
With("DeathSoundIndex", 0x003F, 1).
|
||||
With("NoticeSoundIndex", 0x0040, 1).
|
||||
With("Corpse", 0x0041, 4).As(interpreters.SpecialValue("ObjectTriple")).
|
||||
With("ViewCount", 0x0045, 1).
|
||||
With("SecondaryAttackProbability", 0x0046, 1).
|
||||
With("DisruptProbability", 0x0047, 1).
|
||||
With("TreasureType", 0x0048, 1).As(interpreters.EnumValue(map[uint32]string{
|
||||
0x00: "No treasure",
|
||||
0x01: "Humanoid",
|
||||
0x02: "Drone",
|
||||
0x03: "Assassin",
|
||||
0x04: "Warrior cyborg",
|
||||
0x05: "Flier bot",
|
||||
0x06: "Security 1 bot",
|
||||
0x07: "Exec bot",
|
||||
0x08: "Cyborg enforcer",
|
||||
0x09: "Security 2 bot",
|
||||
0x0A: "Elite cyborg",
|
||||
0x0B: "Standard corpse",
|
||||
0x0C: "Loot-oriented corpse",
|
||||
0x0D: "Electro-stuff treasure",
|
||||
0x0E: "Serv-bot"})).
|
||||
With("HitEffect", 0x0049, 1).As(interpreters.EnumValue(map[uint32]string{0: "meat", 1: "plant", 2: "robot", 3: "cyborg", 4: "generic"})).
|
||||
With("AttackKeyFrame", 0x004A, 1).As(interpreters.RangedValue(0, 10))
|
||||
|
||||
var cyberCritters = interpreters.New().
|
||||
With("Color0", 0, 1).
|
||||
With("Color1", 1, 1).
|
||||
With("Color2", 2, 1).
|
||||
With("AltColor0", 3, 1).
|
||||
With("AltColor1", 4, 1).
|
||||
With("AltColor2", 5, 1)
|
||||
|
||||
func initCritters() {
|
||||
objClass := object.Class(14)
|
||||
|
||||
genericDescriptions[objClass] = critterGenerics
|
||||
|
||||
setSpecific(objClass, 3, cyberCritters)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
)
|
||||
|
||||
var cyberColorScheme = interpreters.New().
|
||||
With("Color0", 0, 1).
|
||||
With("Color1", 1, 1).
|
||||
With("Color2", 2, 1).
|
||||
With("Color3", 3, 1).
|
||||
With("Color4", 4, 1).
|
||||
With("Color5", 5, 1)
|
||||
@@ -0,0 +1,15 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
// GenericProperties returns an interpreter specific for the given object class.
|
||||
func GenericProperties(objClass object.Class, data []byte) *interpreters.Instance {
|
||||
desc := genericDescriptions[objClass]
|
||||
if desc == nil {
|
||||
desc = interpreters.New()
|
||||
}
|
||||
return desc.For(data)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var grenadeGenerics = interpreters.New().
|
||||
Refining("BasicWeapon", 0, 8, basicWeapon, interpreters.Always).
|
||||
With("Touchiness", 8, 1).
|
||||
With("BlastRadius", 9, 1).
|
||||
With("BlastCoreRange", 10, 1).
|
||||
With("BlastDamage", 11, 1).
|
||||
With("AttackMass", 12, 1).
|
||||
With("Flags", 13, 1).As(interpreters.Bitfield(map[uint32]string{
|
||||
0x01: "Explode on contact",
|
||||
0x04: "Explode by timer",
|
||||
0x08: "Explode by vicinity"}))
|
||||
|
||||
var timedExplosives = interpreters.New().
|
||||
With("MinimumTime", 0, 1).
|
||||
With("MaximumTime", 1, 1).
|
||||
With("RandomFactor", 2, 1)
|
||||
|
||||
func initGrenades() {
|
||||
objClass := object.Class(3)
|
||||
|
||||
genericDescriptions[objClass] = grenadeGenerics
|
||||
|
||||
setSpecific(objClass, 1, timedExplosives)
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var basicWeapon = interpreters.New().
|
||||
With("Damage", 0, 2).As(interpreters.RangedValue(0, 0x7FFF)).
|
||||
With("OffenceValue", 2, 1).
|
||||
With("DamageType", 3, 1).As(damageType).
|
||||
With("SpecialDamageType", 4, 1).As(specialDamageType).
|
||||
With("ArmorPenetration", 7, 1)
|
||||
|
||||
var weaponGenerics = interpreters.New().
|
||||
With("FireRate", 0, 1).
|
||||
With("AmmoType", 1, 1).As(interpreters.Bitfield(map[uint32]string{
|
||||
0x01: "AmmoType0",
|
||||
0x02: "AmmoType1",
|
||||
0x04: "AmmoType2",
|
||||
0x08: "AmmoType3",
|
||||
0xF0: "AmmoSubclass"}))
|
||||
|
||||
var projectileWeapons = interpreters.New().
|
||||
Refining("BasicWeapon", 0, 8, basicWeapon, interpreters.Always).
|
||||
With("ProjectileTravelSpeed", 8, 1).
|
||||
With("Projectile", 9, 4).As(interpreters.SpecialValue("ObjectTriple")).
|
||||
With("AttackMass", 13, 1).
|
||||
With("AttackSpeed", 14, 2).As(interpreters.RangedValue(-10000, +10000))
|
||||
|
||||
var meleeWeapons = interpreters.New().
|
||||
Refining("BasicWeapon", 0, 8, basicWeapon, interpreters.Always).
|
||||
With("EnergyUsage", 8, 1).
|
||||
With("AttackMass", 9, 1).
|
||||
With("Range", 10, 1).
|
||||
With("AttackSpeed", 11, 2).As(interpreters.RangedValue(-10000, +10000))
|
||||
|
||||
var energyBeamWeapons = interpreters.New().
|
||||
Refining("BasicWeapon", 0, 8, basicWeapon, interpreters.Always).
|
||||
With("MaxCharge", 8, 1).
|
||||
With("AttackMass", 9, 1).
|
||||
With("Range", 10, 1).
|
||||
With("AttackSpeed", 11, 2).As(interpreters.RangedValue(-10000, +10000))
|
||||
|
||||
var energyProjectileWeapons = interpreters.New().
|
||||
Refining("BasicWeapon", 0, 8, basicWeapon, interpreters.Always).
|
||||
With("MaxCharge", 8, 1).
|
||||
With("AttackMass", 9, 1).
|
||||
With("AttackSpeed", 10, 2).As(interpreters.RangedValue(-10000, +10000)).
|
||||
With("ProjectileTravelSpeed", 12, 1).
|
||||
With("Projectile", 13, 4).As(interpreters.SpecialValue("ObjectTriple")).
|
||||
With("Flags", 17, 1).As(interpreters.Bitfield(map[uint32]string{
|
||||
0x02: "Stun"}))
|
||||
|
||||
func initGuns() {
|
||||
objClass := object.Class(0)
|
||||
|
||||
genericDescriptions[objClass] = weaponGenerics
|
||||
|
||||
setSpecific(objClass, 2, projectileWeapons)
|
||||
setSpecific(objClass, 3, meleeWeapons)
|
||||
setSpecific(objClass, 4, energyBeamWeapons)
|
||||
setSpecific(objClass, 5, energyProjectileWeapons)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var projectileGenerics = interpreters.New().
|
||||
With("Flags", 0, 1).As(interpreters.Bitfield(map[uint32]string{
|
||||
0x01: "EmitLight",
|
||||
0x02: "BounceOffWalls",
|
||||
0x04: "BounceOffObjects",
|
||||
0x08: "BounceOffProjectiles"}))
|
||||
|
||||
var cyberProjectiles = interpreters.New().
|
||||
Refining("ColorScheme", 0, 6, cyberColorScheme, interpreters.Always)
|
||||
|
||||
func initPhysics() {
|
||||
objClass := object.Class(2)
|
||||
|
||||
genericDescriptions[objClass] = projectileGenerics
|
||||
|
||||
setSpecificByType(objClass, 1, 9, cyberProjectiles)
|
||||
setSpecificByType(objClass, 1, 10, cyberProjectiles)
|
||||
setSpecificByType(objClass, 1, 11, cyberProjectiles)
|
||||
setSpecificByType(objClass, 1, 12, cyberProjectiles)
|
||||
setSpecificByType(objClass, 1, 13, cyberProjectiles)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var cyberItems = interpreters.New().
|
||||
Refining("ColorScheme", 0, 6, cyberColorScheme, interpreters.Always)
|
||||
|
||||
func initSmallStuff() {
|
||||
objClass := object.Class(8)
|
||||
|
||||
setSpecific(objClass, 5, cyberItems)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
// SpecificProperties returns an interpreter specific for the given object class and subclass.
|
||||
func SpecificProperties(triple object.Triple, data []byte) *interpreters.Instance {
|
||||
desc := specificDescriptions[triple]
|
||||
if desc == nil {
|
||||
desc = specificDescriptions[object.TripleFrom(int(triple.Class), int(triple.Subclass), anyObjectType)]
|
||||
}
|
||||
if desc == nil {
|
||||
desc = interpreters.New()
|
||||
}
|
||||
return desc.For(data)
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package objprop
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/interpreters"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
)
|
||||
|
||||
var genericDescriptions map[object.Class]*interpreters.Description
|
||||
var specificDescriptions map[object.Triple]*interpreters.Description
|
||||
|
||||
const anyObjectType = 0xFF
|
||||
|
||||
var damageType = interpreters.Bitfield(map[uint32]string{
|
||||
0x01: "Explosion",
|
||||
0x02: "Energy",
|
||||
0x04: "Magnetic",
|
||||
0x08: "Radiation",
|
||||
0x10: "Gas",
|
||||
0x20: "Tranquilizer",
|
||||
0x40: "Needle",
|
||||
0x80: "Bio",
|
||||
})
|
||||
|
||||
var specialDamageType = interpreters.Bitfield(map[uint32]string{
|
||||
0x0F: "Primary (double)",
|
||||
0xF0: "Super (quad)",
|
||||
})
|
||||
|
||||
func init() {
|
||||
genericDescriptions = make(map[object.Class]*interpreters.Description)
|
||||
specificDescriptions = make(map[object.Triple]*interpreters.Description)
|
||||
|
||||
initGuns()
|
||||
initAmmo()
|
||||
initPhysics()
|
||||
initGrenades()
|
||||
initSmallStuff()
|
||||
initAnimating()
|
||||
initCritters()
|
||||
}
|
||||
|
||||
func setSpecific(objClass object.Class, objSubclass int, desc *interpreters.Description) {
|
||||
specificDescriptions[object.TripleFrom(int(objClass), objSubclass, anyObjectType)] = desc
|
||||
}
|
||||
|
||||
func setSpecificByType(objClass object.Class, objSubclass int, objType int, desc *interpreters.Description) {
|
||||
specificDescriptions[object.TripleFrom(int(objClass), objSubclass, objType)] = desc
|
||||
}
|
||||
Reference in New Issue
Block a user