add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
61
gamedata/scripts/bind_anomaly_field.script
Normal file
61
gamedata/scripts/bind_anomaly_field.script
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
--'******************************************************
|
||||
--'* Áèíäåð îáúåêòà ïîëÿ àíîìàëèé.
|
||||
--'******************************************************
|
||||
fields_by_names = {}
|
||||
function bind(obj)
|
||||
obj:bind_object(anomaly_field_binder(obj))
|
||||
end
|
||||
|
||||
class "anomaly_field_binder" (object_binder)
|
||||
function anomaly_field_binder:__init(obj) super(obj)
|
||||
self.last_update = time_global()
|
||||
end
|
||||
|
||||
function anomaly_field_binder:reload(section)
|
||||
object_binder.reload(self, section)
|
||||
end
|
||||
|
||||
function anomaly_field_binder:reinit()
|
||||
object_binder.reinit(self)
|
||||
db.storage[self.object:id()] = {}
|
||||
self.st = db.storage[self.object:id()]
|
||||
end
|
||||
|
||||
function anomaly_field_binder:net_spawn(server_object)
|
||||
if not object_binder.net_spawn(self, server_object) then
|
||||
return false
|
||||
end
|
||||
db.add_zone(self.object)
|
||||
db.add_obj(self.object)
|
||||
fields_by_names[self.object:name()] = self
|
||||
return true
|
||||
end
|
||||
|
||||
function anomaly_field_binder:net_destroy()
|
||||
db.del_zone( self.object )
|
||||
db.del_obj(self.object)
|
||||
db.storage[self.object:id()] = nil
|
||||
fields_by_names[self.object:name()] = nil
|
||||
object_binder.net_destroy(self)
|
||||
end
|
||||
|
||||
function anomaly_field_binder:set_enable(bEnable)
|
||||
if(bEnable) then
|
||||
self.object:enable_anomaly()
|
||||
else
|
||||
self.object:disable_anomaly()
|
||||
end
|
||||
end
|
||||
|
||||
function anomaly_field_binder:update(delta)
|
||||
object_binder.update(self, delta)
|
||||
if(time_global()-self.last_update<10000) then
|
||||
return
|
||||
end
|
||||
self.last_update = time_global()
|
||||
end
|
||||
|
||||
-- Standart function for save
|
||||
function anomaly_field_binder:net_save_relevant()
|
||||
return true
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue