mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 16:26:30 +01:00
Working on cleaning some strange behavior when trying to submitting faulty typeclasses to script system. Also fixing bugs here and there.
This commit is contained in:
parent
dae375d1c4
commit
6cb2b8b745
12 changed files with 301 additions and 141 deletions
|
|
@ -242,7 +242,12 @@ class StateLightSourceOn(Script):
|
|||
prematurely, this hook will also be called in that case.
|
||||
"""
|
||||
# calculate remaining burntime
|
||||
time_burnt = time.time() - self.db.script_started
|
||||
try:
|
||||
time_burnt = time.time() - self.db.script_started
|
||||
except TypeError:
|
||||
# can happen if script_started is not defined
|
||||
time_burnt = self.interval
|
||||
|
||||
burntime = self.interval - time_burnt
|
||||
self.obj.db.burntime = burntime
|
||||
if burntime <= 0:
|
||||
|
|
@ -732,12 +737,7 @@ class CmdAttack(Command):
|
|||
# should return True if target is defeated, False otherwise.
|
||||
return target.at_hit(self.obj, self.caller, damage)
|
||||
elif target.db.health:
|
||||
target.db.health -= damage
|
||||
if target.db.health <= 0:
|
||||
# enemy is down!
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
target.db.health -= damage
|
||||
else:
|
||||
# sorry, impossible to fight this enemy ...
|
||||
self.caller.msg("The enemy seems unaffacted.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue