@@ -57,6 +57,44 @@ function rpp_UpdateDetail(p:offlineplayer):
5757#=============================================================
5858
5959#플레이어 데미지 업데이트
60+ function rpp_UpdateDamage(attacker:offlineplayer, victim:entity) :: number:
61+ set {_attacker.atk} to rpp_GetAtk({_attacker}) # 가해자 공격력
62+ set {_attacker.crc} to rpp_GetCrC({_attacker}) # 가해자 치명타 확률
63+ set {_attacker.crd} to rpp_GetCrD({_attacker}) # 가해자 치명타 데미지
64+ set {_attacker.dep} to rpp_GetDeP({_attacker}) # 가해자 방어력 관통
65+
66+ set {_victim.def} to rpp_GetDef({_victim}) # 피해자 방어력
67+ set {_victim.depi} to rpp_GetDePI({_victim}) # 피해자 방어력 관통 저항
68+ set {_victim.crci} to rpp_GetCrCI({_victim}) # 피해자 치명타 저항
69+
70+ #방어력 관통 계산
71+ set {_cal.dep} to {_attacker.dep} - {_victim.depi}
72+ if {_cal.dep} < 0:
73+ set {_cal.dep} to 0
74+
75+ #방어력 계산
76+ set {_cal.def} to {_victim.def} - ({_victim.def} * {_cal.dep})
77+ if {_cal.def} < 0:
78+ set {_cal.def} to 0
79+
80+ #공격력 계산
81+ set {_cal.atk} to {_attacker.atk} - {_cal.def}
82+ if {_cal.atk} <= 0:
83+ return 0
84+
85+ #치명타 계산
86+ set {_cal.crc} to {_attacker.crc} - {_victim.crci}
87+ if {_cal.crc} <= 0:
88+ return {_cal.atk}
89+
90+ #치명타 발동 계산
91+ set {_crc} to rpp_ReconverionRate({_cal.crc})
92+ set {_r} to random integer between 1 and 10000
93+ if {_r} > {_crc}:
94+ return {_cal.atk}
95+
96+ #치명타 데미지 계산
97+ return {_cal.atk} * {_attacker.crd}
6098
6199#=============================================================
62100
@@ -87,6 +125,12 @@ function rpp_ApplyHp(p:offlineplayer):
87125 set {_id} to rpp_GetID() # ID
88126 set {_uuid} to uuid of {_p} # uuid
89127 set max health of {_p} to {%{_id}%.Hp::%{_uuid}%}
128+
129+ #플레이어 체력 반환
130+ function rpp_GetHp(p:offlineplayer) :: number:
131+ set {_id} to rpp_GetID() # ID
132+ set {_uuid} to uuid of {_p} # uuid
133+ return {%{_id}%.Hp::%{_uuid}%}
90134
91135#=============================================================
92136
@@ -110,6 +154,12 @@ function rpp_ApplyHpR(p:offlineplayer):
110154 set {_id} to rpp_GetID() # ID
111155 set {_uuid} to uuid of {_p} # uuid
112156 add {%{_id}%.HpR::%{_uuid}%} to health of {_p}
157+
158+ #플레이어 체력재생 반환
159+ function rpp_GetHpR(p:offlineplayer) :: number:
160+ set {_id} to rpp_GetID() # ID
161+ set {_uuid} to uuid of {_p} # uuid
162+ return {%{_id}%.HpR::%{_uuid}%}
113163
114164#=============================================================
115165
@@ -127,6 +177,12 @@ function rpp_UpdateAtk(p:offlineplayer):
127177 if {_atk} > {_max}: # 업그레이드된 공격력이 설정된 최대치보다 높다면 공격력 제한
128178 set {_atk} to {_max}
129179 set {%{_id}%.Atk::%{_uuid}%} to {_atk}
180+
181+ #플레이어 공격력 반환
182+ function rpp_GetAtk(p:offlineplayer) :: number:
183+ set {_id} to rpp_GetID() # ID
184+ set {_uuid} to uuid of {_p} # uuid
185+ return {%{_id}%.Atk::%{_uuid}%}
130186
131187#=============================================================
132188
@@ -144,6 +200,12 @@ function rpp_UpdateDef(p:offlineplayer):
144200 if {_def} > {_max}: # 업그레이드된 방어력이 설정된 최대치보다 높다면 방어력 제한
145201 set {_def} to {_max}
146202 set {%{_id}%.Def::%{_uuid}%} to {_def}
203+
204+ #플레이어 방어력 반환
205+ function rpp_GetDef(p:offlineplayer) :: number:
206+ set {_id} to rpp_GetID() # ID
207+ set {_uuid} to uuid of {_p} # uuid
208+ return {%{_id}%.Def::%{_uuid}%}
147209
148210#=============================================================
149211
@@ -169,6 +231,12 @@ function rpp_ApplySpd(p:offlineplayer):
169231 set walk speed of {_p} to {%{_id}%.Spd::%{_uuid}%}
170232 set fly speed of {_p} to {%{_id}%.Spd::%{_uuid}%}
171233
234+ #플레이어 이동속도 반환
235+ function rpp_GetSpd(p:offlineplayer) :: number:
236+ set {_id} to rpp_GetID() # ID
237+ set {_uuid} to uuid of {_p} # uuid
238+ return {%{_id}%.Spd::%{_uuid}%}
239+
172240#=============================================================
173241
174242#플레이어 치명타 확률 업데이트
@@ -186,6 +254,12 @@ function rpp_UpdateCrC(p:offlineplayer):
186254 set {_crc} to {_max}
187255 set {%{_id}%.CrC::%{_uuid}%} to {_crc}
188256
257+ #플레이어 치명타 확률 반환
258+ function rpp_GetCrC(p:offlineplayer) :: number:
259+ set {_id} to rpp_GetID() # ID
260+ set {_uuid} to uuid of {_p} # uuid
261+ return {%{_id}%.CrC::%{_uuid}%}
262+
189263#=============================================================
190264
191265#플레이어 치명타 데미지 업데이트
@@ -203,6 +277,12 @@ function rpp_UpdateCrD(p:offlineplayer):
203277 set {_crd} to {_max}
204278 set {%{_id}%.CrD::%{_uuid}%} to {_crd}
205279
280+ #플레이어 치명타 데미지 반환
281+ function rpp_GetCrD(p:offlineplayer) :: number:
282+ set {_id} to rpp_GetID() # ID
283+ set {_uuid} to uuid of {_p} # uuid
284+ return {%{_id}%.CrD::%{_uuid}%}
285+
206286#=============================================================
207287
208288#플레이어 방어력 관통 업데이트
@@ -220,6 +300,12 @@ function rpp_UpdateDeP(p:offlineplayer):
220300 set {_dep} to {_max}
221301 set {%{_id}%.DeP::%{_uuid}%} to {_dep}
222302
303+ #플레이어 방어력 관통 반환
304+ function rpp_GetDeP(p:offlineplayer) :: number:
305+ set {_id} to rpp_GetID() # ID
306+ set {_uuid} to uuid of {_p} # uuid
307+ return {%{_id}%.DeP::%{_uuid}%}
308+
223309#=============================================================
224310
225311#플레이어 치명타 저항 업데이트
@@ -237,6 +323,12 @@ function rpp_UpdateCrCI(p:offlineplayer):
237323 set {_crci} to {_max}
238324 set {%{_id}%.CrCI::%{_uuid}%} to {_crci}
239325
326+ #플레이어 치명타 저항 반환
327+ function rpp_GetCrCI(p:offlineplayer) :: number:
328+ set {_id} to rpp_GetID() # ID
329+ set {_uuid} to uuid of {_p} # uuid
330+ return {%{_id}%.CrCI::%{_uuid}%}
331+
240332#=============================================================
241333
242334#플레이어 방어력 관통 저항 업데이트
@@ -254,6 +346,12 @@ function rpp_UpdateDePI(p:offlineplayer):
254346 set {_depi} to {_max}
255347 set {%{_id}%.DePI::%{_uuid}%} to {_depi}
256348
349+ #플레이어 방어력 관통 저항 반환
350+ function rpp_GetDePI(p:offlineplayer) :: number:
351+ set {_id} to rpp_GetID() # ID
352+ set {_uuid} to uuid of {_p} # uuid
353+ return {%{_id}%.DePI::%{_uuid}%}
354+
257355#=============================================================
258356
259357
0 commit comments