Exemplo n.º 1
0
 public static void Notify_PawnKilledPostfix(Pawn killed, Pawn killer)
 {
     if (killer != null)
     {
         PawnLvComp pawnlvcomp = killer.TryGetComp <PawnLvComp>();
         if (pawnlvcomp != null)
         {
             pawnlvcomp.exp += (int)killed.kindDef.combatPower * FP_RSLUM_setting.KillExpMult;
             //Log.Message((killed.kindDef.combatPower * FP_RSLUM_setting.KillExpMult).ToString());
             if ((pawnlvcomp.exp > pawnlvcomp.need_exp) && (pawnlvcomp.level < FP_RSLUM_setting.MaxLevel || FP_RSLUM_setting.MaxLevel == 0))
             {
                 pawnlvcomp.levelup();
             }
         }
     }
 }
Exemplo n.º 2
0
 public static void Notify_PawnKilledPostfix(Pawn killed, Pawn killer)
 {
     if (killer != null)
     {
         PawnLvComp pawnlvcomp = killer.TryGetComp <PawnLvComp>();
         if (pawnlvcomp != null)
         {
             // hard-cap exp gain from monster...
             int temp = (int)Math.Min(killed.kindDef.combatPower, 1000) * FP_RSLUM_setting.KillExpMult;
             pawnlvcomp.exp += temp;
             //Log.Message((killed.kindDef.combatPower * FP_RSLUM_setting.KillExpMult).ToString());
             if (pawnlvcomp.need_exp < pawnlvcomp.exp)
             {
                 pawnlvcomp.levelup();
             }
         }
     }
 }
Exemplo n.º 3
0
        public void DoLVUPButton(Rect rect)
        {
            TooltipHandler.TipRegion(rect, Translator.Translate("LvTab_LVUPButtonDesc"));
            if (Widgets.ButtonText(rect, Translator.Translate("LvTab_LVUPButton")))
            {
                IEnumerable <Pawn> Pawns = from p in Find.CurrentMap.mapPawns.AllPawnsSpawned
                                           select p;
                foreach (Pawn pawn in Pawns)
                {
                    PawnLvComp pawnlvcomp = pawn.TryGetComp <PawnLvComp>();
                    if (pawnlvcomp != null)
                    {
                        pawnlvcomp.levelup();
                    }
                }

                Notify_ResolutionChanged();
            }
        }
Exemplo n.º 4
0
        static bool LearnPrefix(SkillRecord __instance, float xp, bool direct)
        {
            if (xp > 0)
            {
                Pawn pawn = pawninfo.GetValue(__instance) as Pawn;

                PawnLvComp pawnlvcomp = pawn.TryGetComp <PawnLvComp>();
                if (pawnlvcomp != null)
                {
                    pawnlvcomp.exp += (int)(xp * FP_RSLUM_setting.ColonistPercent * (1f + (0.01 * pawnlvcomp.INT)));

                    if ((pawnlvcomp.exp > pawnlvcomp.need_exp) && (pawnlvcomp.level < FP_RSLUM_setting.MaxLevel || FP_RSLUM_setting.MaxLevel == 0))
                    {
                        pawnlvcomp.levelup();
                    }
                }

                //Log.Message(pawn.Name + xp.ToString() + " " + ((int)(xp * 100)).ToString());
            }

            return(true);
        }