bada-studio / knights_contract

154 stars 55 forks source link

Make rebirth time as a dynamic value #65

Closed mjshin82 closed 5 years ago

mjshin82 commented 5 years ago

Background

To-be

If rebirth time is short, then increase rebirth waiting time long. if rebirth time is long enough, then reduce rebirth waiting time.

Background

To be

자주 부활할 수록 부활 대기 시간을 늘리도록 수정

Pseudo code

var life = calculate_total_knight_life();
var past = crurrent - player.last_rebirth;

var threshold = min(life * 0.25, 30min);
var rebrith_factor = player.rebrith_factor;

// calculate rebirth exponet
if (past < threshold) {
    var rate = 1 + (threshold - past) / threshold;
    rebrith_factor *= rate;
} else {
    var rate = 1 + (past - threshold) / threshold;
    rebrith_factor /= rate;
}

rebrith_factor = max(1, rebrith_factor);
rebrith_factor = min(15, rebrith_factor);

// calculate next rebirth time
var rebirth_base = 2min;
var next = time.now() + rebirth_base * rebrith_factor;

// save values
save(plyaer, rebrith_factor, next);

Simulation

kyle-heo commented 5 years ago

30분동안 보고있을수 없으니 부활가능시간에 알림 기능도 있었으면 좋겠네요. by sukeban52412

mjshin82 commented 5 years ago

부활시간에 대한 알림은 추후 추가될 예정입니다~