to remain human , a shapeshifter had to live his life according to a very strict mental regimen detailed in the code , a book of rules , which praised discipline , loyalty , obedience , and restraint .