implement loot drops from entities
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
9a20a64d5b
commit
dda20e55cc
@ -190,8 +190,18 @@
|
||||
}
|
||||
],
|
||||
"healthSystem" : {
|
||||
"maxHealth" : 100,
|
||||
"onDamageIFrames" : 5
|
||||
"maxHealth" : 50,
|
||||
"onDamageIFrames" : 5,
|
||||
"lootPool" : {
|
||||
"tickets" : [
|
||||
{
|
||||
"itemId" : "Log",
|
||||
"rarity" : 0.8,
|
||||
"minQuantity" : 0,
|
||||
"maxQuantity" : 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
|
||||
@ -1,435 +1,11 @@
|
||||
{
|
||||
"items" : [
|
||||
|
||||
|
||||
|
||||
{
|
||||
"id" : "Katana",
|
||||
"modelPath" : "Models/items/weapons/katana1alt.fbx",
|
||||
"weaponData" : {
|
||||
"weaponClass" : "sword1h",
|
||||
"damage" : 10,
|
||||
"hitboxes" : [
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade1",
|
||||
"radius": 0.04
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade2",
|
||||
"radius": 0.04
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.04
|
||||
}
|
||||
]
|
||||
},
|
||||
"equipData": {
|
||||
"equipClass" : "weapon"
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"MELEE",
|
||||
"TARGETABLE",
|
||||
"OUTLINE"
|
||||
],
|
||||
"idleAnim" : "Sword|Idle",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.03,
|
||||
"dimension2" : 0.03,
|
||||
"dimension3" : 0.2,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0.0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0.0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconWeapon.png"
|
||||
},
|
||||
{
|
||||
"id" : "Katana2H",
|
||||
"weaponData" : {
|
||||
"weaponClass" : "sword2h",
|
||||
"damage" : 10,
|
||||
"weaponActionMovePenalty" : 0.4,
|
||||
"hitboxes" : [
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade1",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, -0.03]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade2",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, -0.1]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade2",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, 0.02]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, -0.07]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, 0.05]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, 0.15]
|
||||
}
|
||||
]
|
||||
},
|
||||
"itemBlockData": {
|
||||
|
||||
},
|
||||
"equipData": {
|
||||
"equipClass" : "weapon2H"
|
||||
},
|
||||
"itemAudio": {
|
||||
"uiGrabAudio" : "Audio/ui/items/specific/Pick Up Metal A.wav",
|
||||
"uiReleaseAudio" : "Audio/ui/items/specific/Drop Metal A.wav"
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"MELEE",
|
||||
"TARGETABLE",
|
||||
"OUTLINE"
|
||||
],
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"idleData": {
|
||||
"animation": {
|
||||
"nameFirstPerson" : "Idle",
|
||||
"nameThirdPerson" : "Idle",
|
||||
"priorityCategory" : "IDLE"
|
||||
}
|
||||
},
|
||||
"path" : "Models/items/weapons/katana1alt.glb"
|
||||
}
|
||||
},
|
||||
"boneGroups" : [
|
||||
{
|
||||
"id" : "torso",
|
||||
"boneNamesThirdPerson" : []
|
||||
}
|
||||
],
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.04,
|
||||
"dimension2" : 0.04,
|
||||
"dimension3" : 0.8,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0.0,
|
||||
"offsetY" : 0.0,
|
||||
"offsetZ" : 0.0
|
||||
},
|
||||
"iconPath" : "Textures/icons/greatsword.png"
|
||||
},
|
||||
{
|
||||
"id" : "bow1",
|
||||
"modelPath": "Models/bow1.fbx",
|
||||
"weaponData" : {
|
||||
"weaponClass" : "bow2h",
|
||||
"damage" : 10,
|
||||
"projectileModel" : "Models/arrow1.fbx"
|
||||
},
|
||||
"equipData": {
|
||||
"equipClass" : "weapon"
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"RANGED",
|
||||
"TARGETABLE",
|
||||
"OUTLINE"
|
||||
],
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconWeapon.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "shorts1",
|
||||
"modelPath": "Models/items/itemEntityShorts.fbx",
|
||||
"equipData": {
|
||||
"equipClass" : "clothing",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/creatures/person2/clothing/shorts1.fbx",
|
||||
"meshList" : [
|
||||
"ClothingItem"
|
||||
],
|
||||
"meshMaskList" : [
|
||||
"Shorts"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "hairshort1",
|
||||
"modelPath": "Models/itemEntityShorts.fbx",
|
||||
"equipData": {
|
||||
"equipClass" : "trait",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/hairshort1.fbx",
|
||||
"meshList" : [
|
||||
"Hair"
|
||||
],
|
||||
"meshMaskList" : []
|
||||
}
|
||||
]
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"ARMOR",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipClass" : "trait",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "boots1",
|
||||
"modelPath": "Models/boots1.glb",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"ARMOR",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "clothing",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/boots1.glb",
|
||||
"meshList" : [
|
||||
"BootLeft",
|
||||
"BootRight"
|
||||
],
|
||||
"meshMaskList" : [
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "shirt1",
|
||||
"modelPath": "Models/itemEntityShorts.fbx",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"ARMOR",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "clothing",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/shirt1.fbx",
|
||||
"meshList" : [
|
||||
"ClothingItem"
|
||||
],
|
||||
"meshMaskList" : [
|
||||
"ShoulderLeft",
|
||||
"ShoulderRight"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "terrainTool",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "tool"
|
||||
},
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"path" : "Models/items/weapons/shovel1.glb"
|
||||
}
|
||||
},
|
||||
"clientSidePrimary": "ADD_VOXEL",
|
||||
"clientSideSecondary": "OPEN_VOXEL",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "spawningPalette",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "tool"
|
||||
},
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"path" : "Models/basic/geometry/unitvector.glb"
|
||||
}
|
||||
},
|
||||
"clientSidePrimary": "LEVEL_EDIT_SPAWN",
|
||||
"clientSideSecondary": "OPEN_SPAWN_SELECT",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
{
|
||||
"id" : "entityinspector",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "tool"
|
||||
},
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"path" : "Models/items/weapons/shovel1.glb"
|
||||
}
|
||||
},
|
||||
"clientSideSecondary": "INSPECTOR",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
],
|
||||
"files" : [
|
||||
"Data/entity/items/weapons.json",
|
||||
"Data/entity/items/tools.json",
|
||||
"Data/entity/items/clothing.json",
|
||||
"Data/entity/items/materials.json"
|
||||
]
|
||||
}
|
||||
161
assets/Data/entity/items/clothing.json
Normal file
161
assets/Data/entity/items/clothing.json
Normal file
@ -0,0 +1,161 @@
|
||||
{
|
||||
"items" : [
|
||||
{
|
||||
"id" : "shorts1",
|
||||
"modelPath": "Models/items/itemEntityShorts.fbx",
|
||||
"equipData": {
|
||||
"equipClass" : "clothing",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/creatures/person2/clothing/shorts1.fbx",
|
||||
"meshList" : [
|
||||
"ClothingItem"
|
||||
],
|
||||
"meshMaskList" : [
|
||||
"Shorts"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "hairshort1",
|
||||
"modelPath": "Models/itemEntityShorts.fbx",
|
||||
"equipData": {
|
||||
"equipClass" : "trait",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/hairshort1.fbx",
|
||||
"meshList" : [
|
||||
"Hair"
|
||||
],
|
||||
"meshMaskList" : []
|
||||
}
|
||||
]
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"ARMOR",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipClass" : "trait",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "boots1",
|
||||
"modelPath": "Models/boots1.glb",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"ARMOR",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "clothing",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/boots1.glb",
|
||||
"meshList" : [
|
||||
"BootLeft",
|
||||
"BootRight"
|
||||
],
|
||||
"meshMaskList" : [
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "shirt1",
|
||||
"modelPath": "Models/itemEntityShorts.fbx",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"ARMOR",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "clothing",
|
||||
"equipWhitelist" : [
|
||||
{
|
||||
"creatureId" : "human",
|
||||
"model" : "Models/shirt1.fbx",
|
||||
"meshList" : [
|
||||
"ClothingItem"
|
||||
],
|
||||
"meshMaskList" : [
|
||||
"ShoulderLeft",
|
||||
"ShoulderRight"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
}
|
||||
|
||||
],
|
||||
"files" : [
|
||||
]
|
||||
}
|
||||
32
assets/Data/entity/items/materials.json
Normal file
32
assets/Data/entity/items/materials.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"items" : [
|
||||
{
|
||||
"id" : "Log",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"path" : "Models/items/materials/log.glb"
|
||||
}
|
||||
},
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
}
|
||||
],
|
||||
"files" : [
|
||||
]
|
||||
}
|
||||
99
assets/Data/entity/items/tools.json
Normal file
99
assets/Data/entity/items/tools.json
Normal file
@ -0,0 +1,99 @@
|
||||
{
|
||||
"items" : [
|
||||
{
|
||||
"id" : "terrainTool",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "tool"
|
||||
},
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"path" : "Models/items/weapons/shovel1.glb"
|
||||
}
|
||||
},
|
||||
"clientSidePrimary": "ADD_VOXEL",
|
||||
"clientSideSecondary": "OPEN_VOXEL",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
|
||||
{
|
||||
"id" : "spawningPalette",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "tool"
|
||||
},
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"path" : "Models/basic/geometry/unitvector.glb"
|
||||
}
|
||||
},
|
||||
"clientSidePrimary": "LEVEL_EDIT_SPAWN",
|
||||
"clientSideSecondary": "OPEN_SPAWN_SELECT",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
},
|
||||
{
|
||||
"id" : "entityinspector",
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"TARGETABLE"
|
||||
],
|
||||
"equipData": {
|
||||
"equipClass" : "tool"
|
||||
},
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"path" : "Models/items/weapons/shovel1.glb"
|
||||
}
|
||||
},
|
||||
"clientSideSecondary": "INSPECTOR",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
|
||||
}
|
||||
],
|
||||
"files" : [
|
||||
]
|
||||
}
|
||||
188
assets/Data/entity/items/weapons.json
Normal file
188
assets/Data/entity/items/weapons.json
Normal file
@ -0,0 +1,188 @@
|
||||
{
|
||||
"items" : [
|
||||
|
||||
|
||||
|
||||
{
|
||||
"id" : "Katana",
|
||||
"modelPath" : "Models/items/weapons/katana1alt.fbx",
|
||||
"weaponData" : {
|
||||
"weaponClass" : "sword1h",
|
||||
"damage" : 10,
|
||||
"hitboxes" : [
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade1",
|
||||
"radius": 0.04
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade2",
|
||||
"radius": 0.04
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.04
|
||||
}
|
||||
]
|
||||
},
|
||||
"equipData": {
|
||||
"equipClass" : "weapon"
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"MELEE",
|
||||
"TARGETABLE",
|
||||
"OUTLINE"
|
||||
],
|
||||
"idleAnim" : "Sword|Idle",
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.03,
|
||||
"dimension2" : 0.03,
|
||||
"dimension3" : 0.2,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0.0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0.0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconWeapon.png"
|
||||
},
|
||||
{
|
||||
"id" : "Katana2H",
|
||||
"weaponData" : {
|
||||
"weaponClass" : "sword2h",
|
||||
"damage" : 10,
|
||||
"weaponActionMovePenalty" : 0.4,
|
||||
"hitboxes" : [
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade1",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, -0.03]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade2",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, -0.1]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade2",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, 0.02]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, -0.07]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, 0.05]
|
||||
},
|
||||
{
|
||||
"type": "hit_connected",
|
||||
"bone": "Blade3",
|
||||
"radius": 0.06,
|
||||
"offset": [0, 0, 0.15]
|
||||
}
|
||||
]
|
||||
},
|
||||
"itemBlockData": {
|
||||
|
||||
},
|
||||
"equipData": {
|
||||
"equipClass" : "weapon2H"
|
||||
},
|
||||
"itemAudio": {
|
||||
"uiGrabAudio" : "Audio/ui/items/specific/Pick Up Metal A.wav",
|
||||
"uiReleaseAudio" : "Audio/ui/items/specific/Drop Metal A.wav"
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"MELEE",
|
||||
"TARGETABLE",
|
||||
"OUTLINE"
|
||||
],
|
||||
"graphicsTemplate": {
|
||||
"model": {
|
||||
"idleData": {
|
||||
"animation": {
|
||||
"nameFirstPerson" : "Idle",
|
||||
"nameThirdPerson" : "Idle",
|
||||
"priorityCategory" : "IDLE"
|
||||
}
|
||||
},
|
||||
"path" : "Models/items/weapons/katana1alt.glb"
|
||||
}
|
||||
},
|
||||
"boneGroups" : [
|
||||
{
|
||||
"id" : "torso",
|
||||
"boneNamesThirdPerson" : []
|
||||
}
|
||||
],
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.04,
|
||||
"dimension2" : 0.04,
|
||||
"dimension3" : 0.8,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0.0,
|
||||
"offsetY" : 0.0,
|
||||
"offsetZ" : 0.0
|
||||
},
|
||||
"iconPath" : "Textures/icons/greatsword.png"
|
||||
},
|
||||
{
|
||||
"id" : "bow1",
|
||||
"modelPath": "Models/bow1.fbx",
|
||||
"weaponData" : {
|
||||
"weaponClass" : "bow2h",
|
||||
"damage" : 10,
|
||||
"projectileModel" : "Models/arrow1.fbx"
|
||||
},
|
||||
"equipData": {
|
||||
"equipClass" : "weapon"
|
||||
},
|
||||
"tokens" : [
|
||||
"GRAVITY",
|
||||
"RANGED",
|
||||
"TARGETABLE",
|
||||
"OUTLINE"
|
||||
],
|
||||
"collidable": {
|
||||
"type" : "CUBE",
|
||||
"dimension1" : 0.1,
|
||||
"dimension2" : 0.1,
|
||||
"dimension3" : 0.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
"rotW": 1,
|
||||
"offsetX" : 0,
|
||||
"offsetY" : 0.05,
|
||||
"offsetZ" : 0
|
||||
},
|
||||
"iconPath" : "Textures/icons/itemIconWeapon.png"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
],
|
||||
"files" : [
|
||||
]
|
||||
}
|
||||
BIN
assets/Models/items/materials/log.glb
Normal file
BIN
assets/Models/items/materials/log.glb
Normal file
Binary file not shown.
BIN
assets/Models/items/materials/logmodel.png
Normal file
BIN
assets/Models/items/materials/logmodel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
11
assets/Models/items/materials/texturemap.json
Normal file
11
assets/Models/items/materials/texturemap.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"textureMap": {
|
||||
"Models/items/materials/log.glb": [
|
||||
{
|
||||
"meshName" : "Cylinder",
|
||||
"diffuse" : "/Models/items/materials/logmodel.png",
|
||||
"isDefault" : true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Wed Nov 13 15:53:18 EST 2024
|
||||
buildNumber=382
|
||||
#Wed Nov 13 21:13:23 EST 2024
|
||||
buildNumber=384
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
# and may or may not have the sanity to build
|
||||
|
||||
DONE:
|
||||
- Transvoxel Algorithm
|
||||
|
||||
|
||||
TODO(?):
|
||||
@ -11,8 +12,6 @@ TODO(?):
|
||||
- Multigrid optimization
|
||||
- Network optimization
|
||||
|
||||
- Transvoxel Algorithm
|
||||
|
||||
- Building cube voxels w/ LOD
|
||||
|
||||
- Audio Ray Tracing
|
||||
|
||||
@ -1020,6 +1020,10 @@ Fix entity repositioning bugs + Enable recursive logic
|
||||
Fix hitbox manager handling of destruction
|
||||
Fix gridded data cell manager player + entity position handling and refactor to simplify logic
|
||||
Add debug options for entities to reposition on server
|
||||
Item data refactor to make it recursive
|
||||
Loot pool data definition
|
||||
Implement items dropping from entities on death
|
||||
Officially mark transvoxel algo as solved
|
||||
|
||||
|
||||
|
||||
|
||||
6
docs/src/tools/gimp/gimp.md
Normal file
6
docs/src/tools/gimp/gimp.md
Normal file
@ -0,0 +1,6 @@
|
||||
@page gimp Gimp
|
||||
|
||||
Articles on using gimp with the project
|
||||
|
||||
[TOC]
|
||||
- @subpage gimpressionist
|
||||
7
docs/src/tools/gimp/gimpressionist.md
Normal file
7
docs/src/tools/gimp/gimpressionist.md
Normal file
@ -0,0 +1,7 @@
|
||||
@page gimpressionist Gimpressionist
|
||||
|
||||
To convert a high res photo into something a little more impressionistic, apply the filters
|
||||
blur/gaussian blur
|
||||
artistic/GIMPressionist
|
||||
|
||||
This should give you a starting line to paint over and make something looking decently painted.
|
||||
@ -5,3 +5,4 @@
|
||||
- @subpage codegenindex
|
||||
- @subpage indexdocumentation
|
||||
- @subpage jenkins
|
||||
- @subpage gimp
|
||||
|
||||
@ -7,7 +7,7 @@ import electrosphere.entity.state.attack.ClientAttackTree;
|
||||
import electrosphere.entity.state.attack.ShooterTree;
|
||||
import electrosphere.entity.state.equip.ClientToolbarState;
|
||||
import electrosphere.entity.types.creature.CreatureUtils;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.net.parser.net.message.InventoryMessage;
|
||||
|
||||
/**
|
||||
|
||||
@ -15,7 +15,7 @@ import electrosphere.entity.state.inventory.RelationalInventoryState;
|
||||
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.renderer.ui.elements.Div;
|
||||
import electrosphere.renderer.ui.elements.ImagePanel;
|
||||
|
||||
@ -12,7 +12,7 @@ import electrosphere.entity.state.inventory.InventoryUtils;
|
||||
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
||||
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.renderer.ui.elements.Div;
|
||||
import electrosphere.renderer.ui.elements.ImagePanel;
|
||||
|
||||
@ -95,7 +95,7 @@ public class SpawnSelectionPanel {
|
||||
List<CommonEntityType> types = new LinkedList<CommonEntityType>();
|
||||
types.addAll(Globals.gameConfigCurrent.getCreatureTypeLoader().getTypes());
|
||||
types.addAll(Globals.gameConfigCurrent.getFoliageMap().getFoliageList());
|
||||
types.addAll(Globals.gameConfigCurrent.getItemMap().getItems());
|
||||
types.addAll(Globals.gameConfigCurrent.getItemMap().getTypes());
|
||||
types.addAll(Globals.gameConfigCurrent.getObjectTypeMap().getTypes());
|
||||
types = types.stream().filter((type)->type.getId().toLowerCase().contains(searchString.toLowerCase())).toList();
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ import electrosphere.entity.state.inventory.InventoryUtils;
|
||||
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
||||
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.renderer.ui.elements.Div;
|
||||
import electrosphere.renderer.ui.elements.ImagePanel;
|
||||
|
||||
@ -8,7 +8,7 @@ import electrosphere.engine.Globals;
|
||||
import electrosphere.engine.assetmanager.AssetDataStrings;
|
||||
import electrosphere.entity.state.inventory.InventoryUtils;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.renderer.ui.elements.Div;
|
||||
import electrosphere.renderer.ui.elements.Window;
|
||||
|
||||
@ -20,7 +20,7 @@ import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.common.CommonEntityType;
|
||||
import electrosphere.game.data.creature.type.CreatureData;
|
||||
import electrosphere.game.data.foliage.type.FoliageType;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.game.data.units.UnitDefinition;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.renderer.light.DirectionalLight;
|
||||
@ -259,7 +259,7 @@ public class MenuGeneratorsLevelEditor {
|
||||
}));
|
||||
|
||||
//button for spawning all foliage types
|
||||
for(Item item : Globals.gameConfigCurrent.getItemMap().getItems()){
|
||||
for(Item item : Globals.gameConfigCurrent.getItemMap().getTypes()){
|
||||
//spawn foliage button
|
||||
scrollable.addChild(Button.createButton("Spawn " + item.getId(), () -> {
|
||||
LoggerInterface.loggerEngine.INFO("spawn " + item.getId() + "!");
|
||||
|
||||
@ -16,7 +16,7 @@ import electrosphere.entity.types.foliage.FoliageUtils;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.creature.type.CreatureData;
|
||||
import electrosphere.game.data.foliage.type.FoliageType;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.server.datacell.Realm;
|
||||
|
||||
|
||||
@ -718,25 +718,29 @@ public class CollisionEngine {
|
||||
*/
|
||||
protected void destroyDBody(DBody body){
|
||||
spaceLock.acquireUninterruptibly();
|
||||
if(bodies.contains(body)){
|
||||
bodies.remove(body);
|
||||
try {
|
||||
if(bodies.contains(body)){
|
||||
bodies.remove(body);
|
||||
}
|
||||
//destroy all geometries
|
||||
Iterator<DGeom> geomIterator = body.getGeomIterator();
|
||||
while(geomIterator.hasNext()){
|
||||
DGeom geom = geomIterator.next();
|
||||
space.remove(geom);
|
||||
geom.DESTRUCTOR();
|
||||
geom.destroy();
|
||||
}
|
||||
//destroy all joints
|
||||
for(int i = 0; i < body.getNumJoints(); i++){
|
||||
DJoint joint = body.getJoint(i);
|
||||
joint.DESTRUCTOR();
|
||||
joint.destroy();
|
||||
}
|
||||
//destroy actual body
|
||||
body.destroy();
|
||||
} catch (NullPointerException ex){
|
||||
LoggerInterface.loggerEngine.ERROR(ex);
|
||||
}
|
||||
//destroy all geometries
|
||||
Iterator<DGeom> geomIterator = body.getGeomIterator();
|
||||
while(geomIterator.hasNext()){
|
||||
DGeom geom = geomIterator.next();
|
||||
space.remove(geom);
|
||||
geom.DESTRUCTOR();
|
||||
geom.destroy();
|
||||
}
|
||||
//destroy all joints
|
||||
for(int i = 0; i < body.getNumJoints(); i++){
|
||||
DJoint joint = body.getJoint(i);
|
||||
joint.DESTRUCTOR();
|
||||
joint.destroy();
|
||||
}
|
||||
//destroy actual body
|
||||
body.destroy();
|
||||
spaceLock.release();
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ import electrosphere.entity.types.creature.CreatureUtils;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.common.treedata.TreeDataState;
|
||||
import electrosphere.game.data.creature.type.attack.AttackMove;
|
||||
import electrosphere.game.data.item.type.WeaponData;
|
||||
import electrosphere.game.data.item.WeaponData;
|
||||
import electrosphere.net.parser.net.message.EntityMessage;
|
||||
import electrosphere.net.synchronization.annotation.SyncedField;
|
||||
import electrosphere.net.synchronization.annotation.SynchronizableEnum;
|
||||
|
||||
@ -29,7 +29,7 @@ import electrosphere.entity.types.projectile.ProjectileUtils;
|
||||
import electrosphere.game.data.common.treedata.TreeDataState;
|
||||
import electrosphere.game.data.creature.type.attack.AttackMove;
|
||||
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
||||
import electrosphere.game.data.item.type.WeaponData;
|
||||
import electrosphere.game.data.item.WeaponData;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.net.parser.net.message.EntityMessage;
|
||||
import electrosphere.net.synchronization.annotation.SyncedField;
|
||||
|
||||
@ -22,8 +22,8 @@ import electrosphere.entity.types.creature.CreatureUtils;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.common.treedata.TreeDataAnimation;
|
||||
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
||||
import electrosphere.game.data.item.type.EquipWhitelist;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.EquipWhitelist;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.net.parser.net.message.InventoryMessage;
|
||||
import electrosphere.net.parser.net.message.NetworkMessage;
|
||||
|
||||
@ -12,8 +12,8 @@ import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.common.treedata.TreeDataAnimation;
|
||||
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
||||
import electrosphere.game.data.creature.type.equip.ToolbarData;
|
||||
import electrosphere.game.data.item.type.EquipWhitelist;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.EquipWhitelist;
|
||||
import electrosphere.game.data.item.Item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ import electrosphere.game.data.common.treedata.TreeDataAnimation;
|
||||
import electrosphere.game.data.creature.type.block.BlockSystem;
|
||||
import electrosphere.game.data.creature.type.block.BlockVariant;
|
||||
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
||||
import electrosphere.game.data.item.type.EquipWhitelist;
|
||||
import electrosphere.game.data.item.EquipWhitelist;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.net.parser.net.message.InventoryMessage;
|
||||
import electrosphere.net.parser.net.message.NetworkMessage;
|
||||
|
||||
@ -14,7 +14,7 @@ import electrosphere.game.data.creature.type.block.BlockSystem;
|
||||
import electrosphere.game.data.creature.type.block.BlockVariant;
|
||||
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
||||
import electrosphere.game.data.creature.type.equip.ToolbarData;
|
||||
import electrosphere.game.data.item.type.EquipWhitelist;
|
||||
import electrosphere.game.data.item.EquipWhitelist;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -4,7 +4,7 @@ package electrosphere.entity.state.life;
|
||||
import electrosphere.entity.btree.BehaviorTree;
|
||||
import electrosphere.entity.btree.StateTransitionUtil;
|
||||
import electrosphere.entity.btree.StateTransitionUtil.StateTransitionUtilItem;
|
||||
import electrosphere.game.data.creature.type.HealthSystem;
|
||||
import electrosphere.game.data.common.life.HealthSystem;
|
||||
import electrosphere.entity.EntityDataStrings;
|
||||
import electrosphere.entity.Entity;
|
||||
import electrosphere.engine.Globals;
|
||||
|
||||
@ -5,15 +5,18 @@ import electrosphere.entity.btree.BehaviorTree;
|
||||
import electrosphere.entity.btree.StateTransitionUtil;
|
||||
import electrosphere.entity.btree.StateTransitionUtil.StateTransitionUtilItem;
|
||||
import electrosphere.entity.EntityDataStrings;
|
||||
import electrosphere.entity.EntityUtils;
|
||||
import electrosphere.entity.ServerEntityUtils;
|
||||
import electrosphere.entity.Entity;
|
||||
import electrosphere.server.datacell.utils.ServerBehaviorTreeUtils;
|
||||
import electrosphere.net.parser.net.message.CombatMessage;
|
||||
import electrosphere.net.parser.net.message.SynchronizationMessage;
|
||||
import electrosphere.server.datacell.Realm;
|
||||
import electrosphere.server.datacell.utils.DataCellSearchUtils;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.joml.Vector3d;
|
||||
|
||||
@ -22,7 +25,8 @@ import electrosphere.entity.state.hitbox.HitboxCollectionState.HitboxState;
|
||||
import electrosphere.entity.state.life.ClientLifeTree.LifeStateEnum;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.collidable.HitboxData;
|
||||
import electrosphere.game.data.creature.type.HealthSystem;
|
||||
import electrosphere.game.data.common.life.HealthSystem;
|
||||
import electrosphere.game.data.common.life.loot.LootTicket;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.net.synchronization.annotation.SyncedField;
|
||||
import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree;
|
||||
@ -78,6 +82,9 @@ public class ServerLifeTree implements BehaviorTree {
|
||||
this.stateTransitionUtil.simulate(LifeStateEnum.DYING);
|
||||
} break;
|
||||
case DEAD: {
|
||||
if(this.healthSystem.getLootPool() != null){
|
||||
this.rollLootPool();
|
||||
}
|
||||
//delete the entity
|
||||
ServerEntityUtils.destroyEntity(parent);
|
||||
} break;
|
||||
@ -110,6 +117,26 @@ public class ServerLifeTree implements BehaviorTree {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Roll the loot pool
|
||||
*/
|
||||
protected void rollLootPool(){
|
||||
if(this.healthSystem.getLootPool() == null || this.healthSystem.getLootPool().getTickets() == null){
|
||||
return;
|
||||
}
|
||||
Random random = new Random();
|
||||
Vector3d position = new Vector3d(EntityUtils.getPosition(parent));
|
||||
Realm realm = Globals.realmManager.getEntityRealm(parent);
|
||||
for(LootTicket ticket : this.healthSystem.getLootPool().getTickets()){
|
||||
if(random.nextDouble() < ticket.getRarity()){
|
||||
int numToGen = random.nextInt(ticket.getMinQuantity(), ticket.getMaxQuantity());
|
||||
for(int i = 0; i < numToGen; i++){
|
||||
ItemUtils.serverSpawnBasicItem(realm, position, ticket.getItemId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entity is alive
|
||||
* @return true if alive, false otherwise
|
||||
|
||||
@ -74,7 +74,7 @@ import electrosphere.game.data.creature.type.rotator.RotatorItem;
|
||||
import electrosphere.game.data.creature.type.rotator.RotatorSystem;
|
||||
import electrosphere.game.data.foliage.type.FoliageType;
|
||||
import electrosphere.game.data.graphics.GraphicsTemplate;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.net.parser.net.message.EntityMessage;
|
||||
import electrosphere.net.parser.net.message.NetworkMessage;
|
||||
import electrosphere.net.server.player.Player;
|
||||
|
||||
@ -22,11 +22,11 @@ import electrosphere.entity.state.gravity.ServerGravityTree;
|
||||
import electrosphere.entity.state.hitbox.HitboxCollectionState;
|
||||
import electrosphere.entity.types.EntityTypes.EntityType;
|
||||
import electrosphere.entity.types.common.CommonEntityUtils;
|
||||
import electrosphere.game.data.item.EquipData;
|
||||
import electrosphere.game.data.item.EquipWhitelist;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.game.data.item.ItemAudio;
|
||||
import electrosphere.game.data.item.type.EquipData;
|
||||
import electrosphere.game.data.item.type.EquipWhitelist;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.type.WeaponData;
|
||||
import electrosphere.game.data.item.WeaponData;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.net.parser.net.message.EntityMessage;
|
||||
import electrosphere.net.parser.net.message.NetworkMessage;
|
||||
|
||||
@ -14,7 +14,7 @@ import electrosphere.game.data.creature.type.CreatureTypeLoader;
|
||||
import electrosphere.game.data.creature.type.attack.AttackMoveResolver;
|
||||
import electrosphere.game.data.creature.type.model.CreatureTypeMap;
|
||||
import electrosphere.game.data.foliage.type.model.FoliageTypeMap;
|
||||
import electrosphere.game.data.item.type.model.ItemTypeMap;
|
||||
import electrosphere.game.data.item.ItemDataMap;
|
||||
import electrosphere.game.data.projectile.ProjectileTypeHolder;
|
||||
import electrosphere.game.data.tutorial.HintDefinition;
|
||||
import electrosphere.game.data.units.UnitDefinitionFile;
|
||||
@ -30,7 +30,11 @@ import electrosphere.util.FileUtils;
|
||||
public class Config {
|
||||
|
||||
CreatureTypeLoader creatureTypeLoader;
|
||||
ItemTypeMap itemMap;
|
||||
|
||||
/**
|
||||
* The container for all item definitions
|
||||
*/
|
||||
ItemDataMap itemMap;
|
||||
FoliageTypeMap foliageMap;
|
||||
CommonEntityMap objectTypeLoader;
|
||||
SymbolMap symbolMap;
|
||||
@ -70,7 +74,7 @@ public class Config {
|
||||
public static Config loadDefaultConfig(){
|
||||
Config config = new Config();
|
||||
config.creatureTypeLoader = loadCreatureTypes("Data/entity/creatures.json");
|
||||
config.itemMap = FileUtils.loadObjectFromAssetPath("Data/entity/items.json", ItemTypeMap.class);
|
||||
config.itemMap = ItemDataMap.loadItemFiles("Data/entity/items.json");
|
||||
config.foliageMap = FileUtils.loadObjectFromAssetPath("Data/entity/foliage.json", FoliageTypeMap.class);
|
||||
config.objectTypeLoader = loadCommonEntityTypes("Data/entity/objects.json");
|
||||
config.symbolMap = FileUtils.loadObjectFromAssetPath("Data/game/symbolism.json", SymbolMap.class);
|
||||
@ -184,7 +188,7 @@ public class Config {
|
||||
* Gets the data on all item types in memory
|
||||
* @return the data on all items
|
||||
*/
|
||||
public ItemTypeMap getItemMap() {
|
||||
public ItemDataMap getItemMap() {
|
||||
return itemMap;
|
||||
}
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@ import java.util.List;
|
||||
import electrosphere.game.data.collidable.CollidableTemplate;
|
||||
import electrosphere.game.data.collidable.HitboxData;
|
||||
import electrosphere.game.data.common.camera.CameraData;
|
||||
import electrosphere.game.data.common.life.HealthSystem;
|
||||
import electrosphere.game.data.common.light.PointLightDescription;
|
||||
import electrosphere.game.data.creature.type.HealthSystem;
|
||||
import electrosphere.game.data.creature.type.LookAtSystem;
|
||||
import electrosphere.game.data.creature.type.ViewModelData;
|
||||
import electrosphere.game.data.creature.type.ai.AITreeData;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package electrosphere.game.data.creature.type;
|
||||
package electrosphere.game.data.common.life;
|
||||
|
||||
import electrosphere.game.data.common.life.loot.LootPool;
|
||||
import electrosphere.game.data.common.treedata.TreeDataState;
|
||||
|
||||
/**
|
||||
@ -7,10 +8,14 @@ import electrosphere.game.data.common.treedata.TreeDataState;
|
||||
*/
|
||||
public class HealthSystem {
|
||||
|
||||
//the maximum health
|
||||
/**
|
||||
* The maximum health
|
||||
*/
|
||||
int maxHealth;
|
||||
|
||||
//the number of iframes on taking damage
|
||||
/**
|
||||
* The number of iframes on taking damage
|
||||
*/
|
||||
int onDamageIFrames;
|
||||
|
||||
/**
|
||||
@ -18,6 +23,11 @@ public class HealthSystem {
|
||||
*/
|
||||
TreeDataState dyingState;
|
||||
|
||||
/**
|
||||
* The loot pool that can be dropped by this entity on death
|
||||
*/
|
||||
LootPool lootPool;
|
||||
|
||||
/**
|
||||
* Gets the maximum health
|
||||
* @return The maximum health
|
||||
@ -41,16 +51,13 @@ public class HealthSystem {
|
||||
public TreeDataState getDyingState(){
|
||||
return dyingState;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clones health system data
|
||||
* Gets the loot pool that can be dropped by this entity on death
|
||||
* @return The loot pool that can be dropped by this entity on death
|
||||
*/
|
||||
public HealthSystem clone(){
|
||||
HealthSystem rVal = new HealthSystem();
|
||||
rVal.maxHealth = maxHealth;
|
||||
rVal.onDamageIFrames = onDamageIFrames;
|
||||
rVal.dyingState = dyingState;
|
||||
return rVal;
|
||||
public LootPool getLootPool(){
|
||||
return this.lootPool;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package electrosphere.game.data.common.life.loot;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A pool of loot that is dropped when an entity dies
|
||||
*/
|
||||
public class LootPool {
|
||||
|
||||
/**
|
||||
* The tickets that can be generated from this loot pool
|
||||
*/
|
||||
List<LootTicket> tickets;
|
||||
|
||||
/**
|
||||
* Gets the tickets that can be selected from this pool
|
||||
* @return The list of tickets
|
||||
*/
|
||||
public List<LootTicket> getTickets() {
|
||||
return tickets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list of tickets that can be selected from this pool
|
||||
* @param tickets The list of tickets
|
||||
*/
|
||||
public void setTickets(List<LootTicket> tickets) {
|
||||
this.tickets = tickets;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package electrosphere.game.data.common.life.loot;
|
||||
|
||||
/**
|
||||
* A ticket that can be selected when dropping from the loot pool
|
||||
*/
|
||||
public class LootTicket {
|
||||
|
||||
/**
|
||||
* The id of the type of item that can be dropped
|
||||
*/
|
||||
String itemId;
|
||||
|
||||
/**
|
||||
* The rarity of this item dropping
|
||||
*/
|
||||
double rarity;
|
||||
|
||||
/**
|
||||
* The minimum quantity that can be dropped from this ticket
|
||||
*/
|
||||
int minQuantity;
|
||||
|
||||
/**
|
||||
* The maximum quantity that can be dropped from this ticket
|
||||
*/
|
||||
int maxQuantity;
|
||||
|
||||
/**
|
||||
* Gets the id of the type of item that can be dropped
|
||||
* @return The id of the type of item that can be dropped
|
||||
*/
|
||||
public String getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id of the type of item that can be dropped
|
||||
* @param itemId The id of the type of item that can be dropped
|
||||
*/
|
||||
public void setItemId(String itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the rarity of this item dropping
|
||||
* @return The rarity of this item dropping
|
||||
*/
|
||||
public double getRarity() {
|
||||
return rarity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the rarity of this item dropping
|
||||
* @param rarity The rarity of this item dropping
|
||||
*/
|
||||
public void setRarity(double rarity) {
|
||||
this.rarity = rarity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the minimum quantity that can be dropped from this ticket
|
||||
* @return The minimum quantity that can be dropped from this ticket
|
||||
*/
|
||||
public int getMinQuantity() {
|
||||
return minQuantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum quantity that can be dropped from this ticket
|
||||
* @param minQuantity The minimum quantity that can be dropped from this ticket
|
||||
*/
|
||||
public void setMinQuantity(int minQuantity) {
|
||||
this.minQuantity = minQuantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the maximum quantity that can be dropped from this ticket
|
||||
* @return The maximum quantity that can be dropped from this ticket
|
||||
*/
|
||||
public int getMaxQuantity() {
|
||||
return maxQuantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum quantity that can be dropped from this ticket
|
||||
* @param maxQuantity The maximum quantity that can be dropped from this ticket
|
||||
*/
|
||||
public void setMaxQuantity(int maxQuantity) {
|
||||
this.maxQuantity = maxQuantity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package electrosphere.game.data.item.type;
|
||||
package electrosphere.game.data.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package electrosphere.game.data.item.type;
|
||||
package electrosphere.game.data.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package electrosphere.game.data.item.type;
|
||||
package electrosphere.game.data.item;
|
||||
|
||||
import electrosphere.game.data.common.CommonEntityType;
|
||||
import electrosphere.game.data.item.ItemAudio;
|
||||
|
||||
/**
|
||||
* Data on a given item
|
||||
@ -1,4 +1,4 @@
|
||||
package electrosphere.game.data.item.type;
|
||||
package electrosphere.game.data.item;
|
||||
|
||||
/**
|
||||
* Block data for the item
|
||||
52
src/main/java/electrosphere/game/data/item/ItemDataFile.java
Normal file
52
src/main/java/electrosphere/game/data/item/ItemDataFile.java
Normal file
@ -0,0 +1,52 @@
|
||||
package electrosphere.game.data.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Contains a list of item data definitions and a list of sub files
|
||||
*/
|
||||
public class ItemDataFile {
|
||||
|
||||
/**
|
||||
* The item data in this file
|
||||
*/
|
||||
List<Item> items;
|
||||
|
||||
/**
|
||||
* All child files of this one
|
||||
*/
|
||||
List<String> files;
|
||||
|
||||
/**
|
||||
* Gets the item data in this file
|
||||
* @return The item data in this file
|
||||
*/
|
||||
public List<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item data in this file
|
||||
* @param item The item data in this file
|
||||
*/
|
||||
public void setItems(List<Item> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all child files of this one
|
||||
* @return All child files of this one
|
||||
*/
|
||||
public List<String> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets all child files of this one
|
||||
* @param files All child files of this one
|
||||
*/
|
||||
public void setFiles(List<String> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
}
|
||||
113
src/main/java/electrosphere/game/data/item/ItemDataMap.java
Normal file
113
src/main/java/electrosphere/game/data/item/ItemDataMap.java
Normal file
@ -0,0 +1,113 @@
|
||||
package electrosphere.game.data.item;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import electrosphere.entity.Entity;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.util.FileUtils;
|
||||
|
||||
/**
|
||||
* A structure for efficiently looking up items
|
||||
*/
|
||||
public class ItemDataMap {
|
||||
|
||||
/**
|
||||
* The map of item id -> item data
|
||||
*/
|
||||
Map<String,Item> idItemMap = new HashMap<String,Item>();
|
||||
|
||||
/**
|
||||
* Adds item data to the loader
|
||||
* @param name The id of the item
|
||||
* @param type The item data
|
||||
*/
|
||||
public void putType(String id, Item type){
|
||||
idItemMap.put(id,type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets item data from the id of the item
|
||||
* @param id The id of the item
|
||||
* @return The item data if it exists, null otherwise
|
||||
*/
|
||||
public Item getType(String id){
|
||||
return idItemMap.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets item data from the id of the item
|
||||
* @param id The id of the item
|
||||
* @return The item data if it exists, null otherwise
|
||||
*/
|
||||
public Item getItem(String id){
|
||||
return idItemMap.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets item data from a given entity
|
||||
* @param entity The entity to get the item data for
|
||||
* @return The item data if it exists, null otherwise
|
||||
*/
|
||||
public Item getItem(Entity entity){
|
||||
String itemId = ItemUtils.getType(entity);
|
||||
return idItemMap.get(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the collection of all item data
|
||||
* @return the collection of all item data
|
||||
*/
|
||||
public Collection<Item> getTypes(){
|
||||
return idItemMap.values();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the set of all item data id's stored in the loader
|
||||
* @return the set of all item data ids
|
||||
*/
|
||||
public Set<String> getTypeIds(){
|
||||
return idItemMap.keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a child item defintion file
|
||||
* @param filename The filename
|
||||
* @return The list of items in the file
|
||||
*/
|
||||
static List<Item> recursiveReadItemLoader(String filename){
|
||||
List<Item> typeList = new LinkedList<Item>();
|
||||
ItemDataFile loaderFile = FileUtils.loadObjectFromAssetPath(filename, ItemDataFile.class);
|
||||
//push the types from this file
|
||||
for(Item type : loaderFile.getItems()){
|
||||
typeList.add(type);
|
||||
}
|
||||
//push types from any other files
|
||||
for(String filepath : loaderFile.getFiles()){
|
||||
List<Item> parsedTypeList = recursiveReadItemLoader(filepath);
|
||||
for(Item type : parsedTypeList){
|
||||
typeList.add(type);
|
||||
}
|
||||
}
|
||||
return typeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all item definition files recursively
|
||||
* @param initialPath The initial path to recurse from
|
||||
* @return The item defintion interface
|
||||
*/
|
||||
public static ItemDataMap loadItemFiles(String initialPath) {
|
||||
ItemDataMap rVal = new ItemDataMap();
|
||||
List<Item> typeList = recursiveReadItemLoader(initialPath);
|
||||
for(Item type : typeList){
|
||||
rVal.putType(type.getId(), type);
|
||||
}
|
||||
return rVal;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package electrosphere.game.data.item.type;
|
||||
package electrosphere.game.data.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
package electrosphere.game.data.item.type.model;
|
||||
|
||||
import electrosphere.entity.Entity;
|
||||
import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemTypeMap {
|
||||
List<Item> items;
|
||||
|
||||
public List<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public Item getItem(String name){
|
||||
Item rVal = null;
|
||||
for(Item item : items){
|
||||
if(item.getId().equals(name)){
|
||||
rVal = item;
|
||||
break;
|
||||
} else if(item.getId().equalsIgnoreCase(name)){
|
||||
LoggerInterface.loggerEngine.WARNING("Failed to fetch item type data; however, item with different-capitalized name exists! May be a capitalization error!");
|
||||
}
|
||||
}
|
||||
return rVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item data of the item
|
||||
* @param item The item entity
|
||||
* @return The type
|
||||
*/
|
||||
public Item getItem(Entity item){
|
||||
if(item != null && ItemUtils.isItem(item) && ItemUtils.getType(item) != null){
|
||||
return getItem(ItemUtils.getType(item));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,8 +17,8 @@ import electrosphere.game.data.creature.type.CreatureData;
|
||||
import electrosphere.game.data.creature.type.CreatureTypeLoader;
|
||||
import electrosphere.game.data.foliage.type.FoliageType;
|
||||
import electrosphere.game.data.foliage.type.model.FoliageTypeMap;
|
||||
import electrosphere.game.data.item.type.Item;
|
||||
import electrosphere.game.data.item.type.model.ItemTypeMap;
|
||||
import electrosphere.game.data.item.Item;
|
||||
import electrosphere.game.data.item.ItemDataMap;
|
||||
import electrosphere.test.annotations.IntegrationTest;
|
||||
import electrosphere.test.template.EntityTestTemplate;
|
||||
import electrosphere.test.testutils.TestEngineUtils;
|
||||
@ -39,8 +39,8 @@ public class SpawnAllEntitiesTests extends EntityTestTemplate {
|
||||
CreatureUtils.serverSpawnBasicCreature(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), creature.getId(), CreatureTemplate.createDefault(creature.getId()));
|
||||
}
|
||||
|
||||
ItemTypeMap itemMap = Globals.gameConfigCurrent.getItemMap();
|
||||
for(Item item : itemMap.getItems()){
|
||||
ItemDataMap itemMap = Globals.gameConfigCurrent.getItemMap();
|
||||
for(Item item : itemMap.getTypes()){
|
||||
ItemUtils.serverSpawnBasicItem(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), item.getId());
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user