From 8b7bce95b0eec202b7751de616bc3cf6ba59163a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 23 Jan 2020 21:17:05 -0300 Subject: Sketches --- npc/functions/honor.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'npc') diff --git a/npc/functions/honor.txt b/npc/functions/honor.txt index 0d1c0138d..8ebe86cd8 100644 --- a/npc/functions/honor.txt +++ b/npc/functions/honor.txt @@ -42,20 +42,21 @@ function script get_BR { function script calc_HR { .@atk_br=getarg(0); .@def_br=getarg(1); - .@cbase=10000; + .@cbase=1000; + .@maxop=300; // 30% - // Dishonorable - if (.@atk_br > .@def_br) { - .@overpower=.@atk_br*.@cbase/.@def_br; - // Honorable - } else if (.@def_br > .@atk_br) { - .@overpower=.@atk_br*.@cbase/.@def_br; - // Neutral + // Calculate how much (%) you've used above needed + .@overpower=.@atk_br*.@cbase/.@def_br; + + // Dishonorable: You used maxop above cbase + // Maybe we should use level difference? + if (.@overpower > .@cbase+.@maxop) { + .@honor=-(0); } else { - .@overpower=0; + .@honor=0; } - return 0; + return .@honor; } // getvariableofpc(HONOR, .@rid, 0) < 0 → determine if other player is bandit -- cgit v1.2.3-70-g09d2