Skip to content

Instantly share code, notes, and snippets.

@starhoshi
Created December 5, 2017 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starhoshi/434961222e1059efb7d9b7e0cbab98dd to your computer and use it in GitHub Desktop.
Save starhoshi/434961222e1059efb7d9b7e0cbab98dd to your computer and use it in GitHub Desktop.
//
// Nature.swift
// DamageZ-VIPER
//
// Created by Kensuke Hoshikawa on 2017/10/11.
// Copyright © 2017年 star__hoshi. All rights reserved.
//
import Foundation
public enum Nature: Int {
case noNature = 0, adamant, rash, timid, calm, mild, gentle, hardy, quirky, lonely, careful, docile, bold, hasty, bashful, sassy, lax, relaxed, modest, serious, naive, naughty, brave, jolly, quiet, impish
public static let count: Int = {
var i = 0
while let _ = Nature(rawValue: i) { i += 1 }
return i
}()
}
extension Nature {
var name: String {
switch self {
case .noNature:
return "性格未選択"
case .adamant:
return "いじっぱり"
case .rash:
return "うっかりや"
case .timid:
return "おくびょう"
case .calm:
return "おだやか"
case .mild:
return "おっとり"
case .gentle:
return "おとなしい"
case .hardy:
return "がんばりや"
case .quirky:
return "きまぐれ"
case .lonely:
return "さみしがり"
case .careful:
return "しんちょう"
case .docile:
return "すなお"
case .bold:
return "ずぶとい"
case .hasty:
return "せっかち"
case .bashful:
return "てれや"
case .sassy:
return "なまいき"
case .lax:
return "のうてんき"
case .relaxed:
return "のんき"
case .modest:
return "ひかえめ"
case .serious:
return "まじめ"
case .naive:
return "むじゃき"
case .naughty:
return "やんちゃ"
case .brave:
return "ゆうかん"
case .jolly:
return "ようき"
case .quiet:
return "れいせい"
case .impish:
return "わんぱく"
}
}
var stat: NatureStat {
switch self {
case .noNature:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .notChange, s: .notChange)
case .adamant:
return NatureStat(h: .notChange, a: .increase, b: .notChange, c: .decrease, d: .notChange, s: .notChange)
case .rash:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .increase, d: .decrease, s: .notChange)
case .timid:
return NatureStat(h: .notChange, a: .decrease, b: .notChange, c: .notChange, d: .notChange, s: .increase)
case .calm:
return NatureStat(h: .notChange, a: .decrease, b: .notChange, c: .notChange, d: .increase, s: .notChange)
case .mild:
return NatureStat(h: .notChange, a: .notChange, b: .decrease, c: .increase, d: .notChange, s: .notChange)
case .gentle:
return NatureStat(h: .notChange, a: .notChange, b: .decrease, c: .notChange, d: .increase, s: .notChange)
case .hardy:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .notChange, s: .notChange)
case .quirky:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .notChange, s: .notChange)
case .lonely:
return NatureStat(h: .notChange, a: .increase, b: .decrease, c: .notChange, d: .notChange, s: .notChange)
case .careful:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .decrease, d: .increase, s: .notChange)
case .docile:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .notChange, s: .notChange)
case .bold:
return NatureStat(h: .notChange, a: .decrease, b: .increase, c: .notChange, d: .notChange, s: .notChange)
case .hasty:
return NatureStat(h: .notChange, a: .notChange, b: .decrease, c: .notChange, d: .notChange, s: .increase)
case .bashful:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .notChange, s: .notChange)
case .sassy:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .increase, s: .decrease)
case .lax:
return NatureStat(h: .notChange, a: .notChange, b: .increase, c: .notChange, d: .decrease, s: .notChange)
case .relaxed:
return NatureStat(h: .notChange, a: .notChange, b: .increase, c: .notChange, d: .notChange, s: .decrease)
case .modest:
return NatureStat(h: .notChange, a: .decrease, b: .notChange, c: .increase, d: .notChange, s: .notChange)
case .serious:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .notChange, s: .notChange)
case .naive:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .notChange, d: .decrease, s: .increase)
case .naughty:
return NatureStat(h: .notChange, a: .increase, b: .notChange, c: .notChange, d: .decrease, s: .notChange)
case .brave:
return NatureStat(h: .notChange, a: .increase, b: .notChange, c: .notChange, d: .notChange, s: .decrease)
case .jolly:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .decrease, d: .notChange, s: .increase)
case .quiet:
return NatureStat(h: .notChange, a: .notChange, b: .notChange, c: .increase, d: .notChange, s: .decrease)
case .impish:
return NatureStat(h: .notChange, a: .notChange, b: .increase, c: .decrease, d: .notChange, s: .notChange)
}
}
}
@starhoshi
Copy link
Author

starhoshi commented Dec 5, 2017

print(Nature.adamant.a.rawValue)
// => 1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment