Jump to content

Efekt krytycznego zranienia [SoC]


Recommended Posts

NAZWA: Efekt krytycznego zranienia [SoC]
AUTOR: XMK

 

POTRZEBNE PLIKI:

Spoiler
  • effect_blood.script (tworzymy ten plik)
  • bind_stalker.script

 

OPERACJE NA PLIKACH:

Spoiler

1. EFFECT_BLOOD.SCRIPT:

Spoiler

Piszemy w nowoutworzonym pliku:

lite_treshold = 0.05 -- o ile punktów zdrowie powinno spaść od poprzedniej aktualizacji, aby ekran zmienił kolor na czerwony
crit_treshold = 0.30 -- o ile zdrowia powinno spaść od poprzedniej aktualizacji, aby GG szarpnęło
drop_item_on_crit_prob = 0.20 -- prawdopodobieństwo, że GG wypadnie broń z rąk
effector_power_coeff = 0.7
prev_health = -1
chk_h_t = 0

function wounded_pp_update()
   if (chk_h_t or 0) < time_global() then
     chk_h_t = time_global()+1000
     if prev_health > (db.actor.health + lite_treshold) then
       level.add_pp_effector("fire_hit.ppe", 2011, false)
       local effector_power = (prev_health - db.actor.health)*100*effector_power_coeff
       level.set_pp_effector_factor(2011, effector_power)
       if prev_health > db.actor.health + crit_treshold then
         level.add_cam_effector("camera_effects\\fusker.anm", 999, false, "")     
         local snd_obj = xr_sound.get_safe_sound_object([[actor\pain_3]])
         snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
         if math.random() < drop_item_on_crit_prob then
           local active_item = db.actor:active_item()
           if active_item and active_item:section() ~= "bolt" and active_item:section()~= "wpn_knife" then
             db.actor:drop_item(active_item)
           end
         end
       end
     end
     prev_health = db.actor.health
   end
end

 

 

2. BIND_STALKER.SCRIPT:

Spoiler

Po linijkach:

function actor_binder:update(delta)
   object_binder.update(self, delta)
   local time = time_global()
   game_stats.update (delta, self.object)

dopisujemy:

effect_blood.wounded_pp_update()

 

 

 

ŹRÓDŁO:

https://ap-pro.ru/forums/topic/1187-effekt-kriticheskogo-raneniya/

Link to comment
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.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.