diff --git a/arkadia/substitute.tf b/arkadia/substitute.tf index d5bd6c9..cae36f0 100644 --- a/arkadia/substitute.tf +++ b/arkadia/substitute.tf @@ -1,3 +1,6 @@ +;; self +/def -mregexp -Fp3 -t' ty(, | i )' _selfupper=/test substitute(strcat({PL}, decode_attr(" --TY--", {zc_alarm}), {P1}, {PR})) + ;; poziomy /def -mregexp -p2 -t'^Wyglada(|sz) na kompletnego zoltodzioba\.' _poziomy_doswiadczenia_1 = /_sub 1/17@{n} /def -mregexp -p2 -t'^Wyglada(|sz) na kogos, kto stawia pierwsze kroki\.' _poziomy_doswiadczenia_2 = /_sub 2/17@{n} @@ -68,12 +71,44 @@ /def -mregexp -PB -Fp2 -t'perfekcyjnie przed(?: obrazeniami|)' _skutecznosc_zbro12 = /_sub_inside (12/12) ;; kondycja -/def -mregexp -Fp2 -t'Jestes (w swietnej kondycji|w dobrym stanie|.* rann.|w zlej kondycji|ledwo zyw.). Atakuj(e|a) cie (.*)' _kondycja_show_me = \ - /return substitute(strcat({PL}, "Jestes", {P1}, ". ", decode_attr(decode_attr("<<<<<< ATAKUJA", {zc_bold}), {zc_crit_background}), " ", {P3})) -/def -mregexp -Fp2 -t'jest (w swietnej kondycji|w dobrym stanie|.* rann.|w zlej kondycji|ledwo zyw.). Atakuj(e|a) (ja|je|go) (.*)' _kondycja_show_others = \ - /return substitute(strcat({PL}, "jest ", {P1}, ". ", decode_attr("<<<<<< ", {zc_alarm}), {P4})) -/def -mregexp -Fp2 -t'Atakujesz (go|ja|je).' _kondycja_show_byme = \ - /return substitute(strcat({PL}, decode_attr("<<<<<< ATAKUJESZ", {zc_crit}))) +/def _count_enemies = \ + /while ({#}) \ + /test ++_enemy%;\ + /shift%;\ + /done + +/def -mregexp -Fp1 -t'ledwo zyw.' _sub_ledwo = /return substitute(strcat({PL}, decode_attr(decode_attr(toupper({P0}), {zc_bold}), {zc_crit_background}), {PR})) + +;;/def -mregexp -Fp2 -t'Jestes (w swietnej kondycji|w dobrym stanie|(?:lekko |ciezko |)rann.|w zlej kondycji|ledwo zyw.).' _sub_kondycja_me = /return substitute(strcat({PL}, decode_attr("### TY ### ", {zc_bold}), {P1}, {PR})) + +/def -mregexp -Fp2 -t'([Jj]est(?:es|)) (w swietnej kondycji|w dobrym stanie|(?:lekko |ciezko |)rann.|w zlej kondycji|ledwo zyw.).$' _sub_kondycja_no_fight = \ + /if ({P1} =~"Jestes")\ + /return substitute(strcat("[-] ", {PL}, decode_attr("### TY ### ", {zc_bold}), {P2}, {PR}))%;\ + /else \ + /return substitute(strcat("[-] ", {PL}, {P1}, " ", {P2}, {PR}))%;\ + /endif + +/def -mregexp -Fp2 -t'([Jj]est(?:es|)) (w swietnej kondycji|w dobrym stanie|(?:lekko |ciezko |)rann.|w zlej kondycji|ledwo zyw.). Atakuj(?:e|a|esz) (go|ja|je|jego|to|cie)' _sub_kondycja_show = \ + /def -ag -Fp2 -mregexp -t'^$$' __kondycja_gag_empty%;\ + /repeat -0.1 1 /purge __kondycja_gag_empty%;\ + /let _enemy_count=0%;\ + /let _enemies=$[replace("##", " ", replace(" ", "_",replace(", ", "##", replace(" i ", "##", {PR}))))]%;\ + /_count_enemies %{_enemies}%;\ + /let _enemy_count=%{_enemy} %;\ + /if (_enemy_count =~ "") \ + /let _enemy_count 0 %;\ + /endif %;\ + /unset _enemy %;\ + /if ({PR} =~ ".") \ + /let _ktobije=$[decode_attr(" ATAKUJESZ", {zc_crit})]%;\ + /else \ + /let _ktobije=%{PR}%;\ + /endif%;\ + /if ({P1} =~"Jestes")\ + /return substitute(strcat("[", decode_attr({_enemy_count}, {zc_bold}), "] ", {PL}, decode_attr("### TY ### ", {zc_bold}), {P2}, ". ", "<<<<<", {_ktobije}))%;\ + /else \ + /return substitute(strcat("[", decode_attr({_enemy_count}, {zc_bold}), "] ", {PL}, {P1}, " ", {P2}, ". ", "<<<<<", {_ktobije}))%;\ + /endif ;; odporności /def odpornosci_stany = \ diff --git a/common/substitute.tf b/common/substitute.tf index 6e89a73..6132c01 100644 --- a/common/substitute.tf +++ b/common/substitute.tf @@ -1,5 +1,3 @@ -/def -mregexp -Fp3 -t'ledwo zyw.' _sub_ledwo = /substitute -p %{PL}@{C%c_bold}@{Cbg%c_crit_bold}$[toupper({P0})]@{n}%{PR} - /def _sub = \ /return substitute(strcat(decode_attr(strcat({PL}, {P0}, {PR}, " [", {1}, "] "))))