Jump to content
Korean Random
Doojka

Получение урона на всей карте

Recommended Posts

Вопрос: есть ли функция в которой передается кто и кому нанес определенный урон?

Share this post


Link to post

Short link
Share on other sites

Вопрос: есть ли функция в которой передается кто и кому нанес определенный урон?

Эти глянь

from Vehicle import Vehicle
from Avatar import PlayerAvatar

PlayerAvatar.showVehicleDamageInfo

Vehicle.onHealthChanged
Vehicle.showDamageFromShot
Vehicle.showDamageFromExplosion
Edited by SkepticalFox

Share this post


Link to post

Short link
Share on other sites

Эти глянь

from Vehicle import Vehicle
from Avatar import PlayerAvatar

PlayerAvatar.showVehicleDamageInfo

Vehicle.onHealthChanged
Vehicle.showDamageFromShot
Vehicle.showDamageFromExplosion

Смотрел этот - Vehicle.showDamageFromShot

Вот только не нашел где там можно получить количество нанесенного урона.

Share this post


Link to post

Short link
Share on other sites

Смотрел этот - Vehicle.showDamageFromShot

Вот только не нашел где там можно получить количество нанесенного урона.

Health = {}

Vehicle_onEnterWorld(self, prereqs):
   newHealth = max(self.health, 0)
   Health[self.id] = newHealth

Vehicle_onHealthChanged(self, newHealth, attackerID, attackReasonID):
   newHealth = max(newHealth, 0)
   Damage = Health[self.id] - newHealth
   print 'Damage = ', Damage
   Health[self.id] = newHealth

И, таки да, на всей карте - нельзя. Только в круге отрисовки (565 метров).

Edited by sl101

Share this post


Link to post

Short link
Share on other sites
Health = {}

Vehicle_onEnterWorld(self, prereqs):
   newHealth = max(self.health, 0)
   Health[self.id] = newHealth

Vehicle_onHealthChanged(self, newHealth, attackerID, attackReasonID):
   newHealth = max(newHealth, 0)
   Damage = Health[self.id] - newHealth
   print 'Damage = ', Damage
   Health[self.id] = newHealth

И, таки да, на всей карте - нельзя. Только в круге отрисовки (565 метров).

Спасибо

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...