223 lines
3.7 KiB
Smali
223 lines
3.7 KiB
Smali
.class public final Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "PremiumGuildSubscriptionUtils.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final DEFAULT_GUILD_SUBSCRIPTION_GUILD_COUNT:I = 0x1
|
|
|
|
.field public static final DEFAULT_GUILD_SUBSCRIPTION_SLOT_COUNT:I = 0x1
|
|
|
|
.field public static final INSTANCE:Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;
|
|
|
|
.field public static final PREMIUM_SUBSCRIPTION_COOLDOWN_DAYS:I = 0x7
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;->INSTANCE:Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getCurrentTierSubs(I)I
|
|
.locals 2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eq p1, v0, :cond_2
|
|
|
|
if-eq p1, v1, :cond_1
|
|
|
|
const/4 v0, 0x3
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/16 v1, 0x1e
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/16 v1, 0xf
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return v1
|
|
.end method
|
|
|
|
.method private final getNextTierSubs(I)I
|
|
.locals 2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eq p1, v0, :cond_2
|
|
|
|
if-eq p1, v1, :cond_1
|
|
|
|
const/4 v0, 0x3
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/16 v1, 0x1e
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/16 v1, 0xf
|
|
|
|
:goto_0
|
|
return v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final calculatePercentToNextTier(II)I
|
|
.locals 2
|
|
|
|
const/16 v0, 0x64
|
|
|
|
const/4 v1, 0x3
|
|
|
|
if-lt p1, v1, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;->getNextTierSubs(I)I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;->getCurrentTierSubs(I)I
|
|
|
|
move-result p1
|
|
|
|
sub-int/2addr p2, p1
|
|
|
|
int-to-float p1, p2
|
|
|
|
int-to-float p2, v1
|
|
|
|
div-float/2addr p1, p2
|
|
|
|
int-to-float p2, v0
|
|
|
|
mul-float p1, p1, p2
|
|
|
|
invoke-static {p1}, Le/k/a/c/e/p/g;->roundToInt(F)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final calculateTotalProgress(II)I
|
|
.locals 2
|
|
|
|
const/4 v0, 0x3
|
|
|
|
if-lt p1, v0, :cond_0
|
|
|
|
const/16 p1, 0x64
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;->getNextTierSubs(I)I
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/premium/PremiumGuildSubscriptionUtils;->getCurrentTierSubs(I)I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr p2, v1
|
|
|
|
int-to-float p2, p2
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
int-to-float v0, v0
|
|
|
|
div-float/2addr p2, v0
|
|
|
|
int-to-float p1, p1
|
|
|
|
const v0, 0x42053333 # 33.3f
|
|
|
|
mul-float p1, p1, v0
|
|
|
|
mul-float p2, p2, v0
|
|
|
|
add-float/2addr p2, p1
|
|
|
|
invoke-static {p2}, Le/k/a/c/e/p/g;->roundToInt(F)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final getPremiumGuildTier(I)I
|
|
.locals 2
|
|
|
|
const/4 v0, 0x2
|
|
|
|
const/16 v1, 0x1e
|
|
|
|
if-lt p1, v1, :cond_0
|
|
|
|
const/4 v0, 0x3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/16 v1, 0xf
|
|
|
|
if-lt p1, v1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
if-lt p1, v0, :cond_2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|