Camera system YAY!!!
This commit is contained in:
65
Scripts/Gameplay/Location/cLocation.gd
Normal file
65
Scripts/Gameplay/Location/cLocation.gd
Normal file
@@ -0,0 +1,65 @@
|
||||
class_name cLocation
|
||||
|
||||
var locationGraph = Global.locations
|
||||
|
||||
var location: Dictionary
|
||||
var locationID: String
|
||||
|
||||
var name: String
|
||||
var connections: Array
|
||||
|
||||
var enemyTemplate = {
|
||||
"present": false,
|
||||
"state": 0
|
||||
}
|
||||
|
||||
var construct = enemyTemplate.duplicate()
|
||||
var yoshida = enemyTemplate.duplicate()
|
||||
var akers = enemyTemplate.duplicate()
|
||||
var flesher = enemyTemplate.duplicate()
|
||||
|
||||
func _init(id: String):
|
||||
# Set immediate values
|
||||
locationID = id
|
||||
print(locationGraph)
|
||||
print(id)
|
||||
location = locationGraph.get(id)
|
||||
|
||||
# Set Fields
|
||||
name = location.get("name")
|
||||
connections = location.get("connections")
|
||||
|
||||
func isPresent(character: String) -> bool:
|
||||
match character:
|
||||
"construct":
|
||||
return construct.get("present")
|
||||
"yoshida":
|
||||
return yoshida.get("present")
|
||||
"akers":
|
||||
return akers.get("present")
|
||||
"flesher":
|
||||
return flesher.get("present")
|
||||
return false
|
||||
|
||||
func getState(character: String) -> int:
|
||||
match character:
|
||||
"construct":
|
||||
return construct.get("state")
|
||||
"yoshida":
|
||||
return yoshida.get("state")
|
||||
"akers":
|
||||
return akers.get("state")
|
||||
"flesher":
|
||||
return flesher.get("state")
|
||||
return -1
|
||||
|
||||
func makeHash() -> String:
|
||||
var hash = ""
|
||||
var characters = ["construct", "yoshida", "akers", "flesher"]
|
||||
|
||||
for c in characters:
|
||||
if isPresent(c):
|
||||
hash += c[0]
|
||||
hash += str( getState(c) )
|
||||
|
||||
return hash
|
||||
1
Scripts/Gameplay/Location/cLocation.gd.uid
Normal file
1
Scripts/Gameplay/Location/cLocation.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cor2nfptbpmby
|
||||
Reference in New Issue
Block a user