Esempio n. 1
0
        } //移动

        public int active_Visit(uint seer_id, uint person_id)
        {
            lc_Seer        seer   = GetObject <lc_Seer>(seer_id);
            uint           rel_id = GetRelShip <STU_PEO_REL>(seer_id).rel_id;
            lc_Religion    rel    = GetObject <lc_Religion>(rel_id);
            lc_Personality person = GetObject <lc_Personality>(person_id);

            int chgnum = seer.m_eloquence * 2 - person.m_risist;

            if (chgnum <= 0)
            {
                return(5);             /*转变程度小于0*/
            }
            if (GetRelShip <STU_PEO_REL>(person_id).rel_id == DEFREL)
            {
                int ret = SetPeoRel(person.obj_id, rel.obj_id, chgnum);
                if (ret == 3)
                {
                    return(3);          /*增加该人物转变*/
                }
                else if (ret == 4)
                {
                    return(4);               /*成功转变该人物*/
                }
                else
                {
                    return(-1); /*逻辑错误*/
                }
            }
            else
            {
                return(2); /*该人物已信仰其他宗教*/
            }
        } //拜访
Esempio n. 2
0
        } //拜访

        public int active_Build(uint peo_id, uint building_id)
        {
            lc_Seer seer    = GetObject <lc_Seer>(peo_id);
            uint    city_id = GetRelShip <STU_PEO_CITY>(peo_id).city_id;
            lc_City city    = GetObject <lc_City>(city_id);
            int     ret     = CityAddBuilding(city.obj_id, seer.obj_id, building_id);

            return(ret);
        } //修建建筑
Esempio n. 3
0
 public lc_Seer(lc_Seer srcTag) : base(srcTag)
 {
     //this.m_type = srcTag.m_type;
     this.m_eloquence    = srcTag.m_eloquence;
     this.m_leadership   = srcTag.m_leadership;
     this.m_intelligence = srcTag.m_intelligence;
     this.m_willpower    = srcTag.m_willpower;
     this.m_wealth       = srcTag.m_wealth;
     this.m_fame         = srcTag.m_fame;
 }
Esempio n. 4
0
        } /*宗教删除规则*/

        public int CityAddBuilding(uint city_id, uint peo_id, uint building_id)
        {
            uint        rel_belong;
            uint        obj_id;
            int         index    = lc_ObjGather.GetRelNameMap("STU_CITY_BUILDING");
            lc_City     city     = GetObject <lc_City>(city_id);
            lc_Building building = GetObject <lc_Building>(building_id);
            lc_Seer     seer     = GetObject <lc_Seer>(peo_id);

            if (peo_id != 0)
            {
                if (seer.m_wealth < building.m_cost)
                {
                    return(0);
                }
                seer.m_wealth -= building.m_cost;
            }

            if (building.m_belong)
            {
                STU_PEO_REL stu_peo_rel = GetRelShip <STU_PEO_REL>(peo_id);
                rel_belong = stu_peo_rel.rel_id;
            }
            else
            {
                rel_belong = 0;
            }

            STU_CITY_BUILDING stu_city_build = new STU_CITY_BUILDING(city_id, building.obj_id, rel_belong);

            objgather.relship_list[index].Add(stu_city_build);

            foreach (var chgnum in building.chglist)
            {
                int typeindex = lc_ObjGather.GetObjNameMap(chgnum.objtype);
                switch (chgnum.objtype)
                {
                case "BUILDING":
                    obj_id = building.obj_id;
                    break;

                case "RELIGION":
                    obj_id = stu_city_build.rel_belong_id;
                    break;

                default:
                    return(-1);
                }

                lc_Object obj = objgather.obj_list[typeindex].Find(delegate(lc_Object temp) { return(temp.obj_id == obj_id); });
                obj.ChangeVar <int>(chgnum.varname, chgnum.chgnum);
            }

            return(1);
        } /*城市增加建筑*/
Esempio n. 5
0
        } //修建建筑

        public int active_Meditation(uint peo_id)
        {
            lc_Seer     seer   = GetObject <lc_Seer>(peo_id);
            uint        rel_id = GetRelShip <STU_PEO_REL>(peo_id).rel_id;
            lc_Religion rel    = GetObject <lc_Religion>(rel_id);

            int chgnum = seer.m_intelligence;

            rel.m_theorypt += chgnum;
            return(1);
        } //冥思
Esempio n. 6
0
        } //传教

        public int active_Move(uint peo_id, uint tag_city_id)
        {
            lc_Seer seer        = GetObject <lc_Seer>(peo_id);
            uint    cur_city_id = GetRelShip <STU_PEO_CITY>(peo_id).city_id;

            if (cur_city_id == tag_city_id)
            {
                return(-1);
            }

            SetPeoCity(peo_id, tag_city_id);

            return(1);
        } //移动
Esempio n. 7
0
        //玩家行为
        public int active_Preach(uint peo_id)
        {
            lc_Seer     seer           = GetObject <lc_Seer>(peo_id);
            uint        rel_id         = GetRelShip <STU_PEO_REL>(peo_id).rel_id;
            lc_Religion rel            = GetObject <lc_Religion>(rel_id);
            uint        city_id        = GetRelShip <STU_PEO_CITY>(peo_id).city_id;
            lc_City     city           = GetObject <lc_City>(city_id);
            uint        country_id     = GetRelShip <STU_CITY_COUNTRY>(city_id).country_id;
            lc_Country  country        = GetObject <lc_Country>(country_id);
            int         city_rel_index = GetRelShip <STU_CITY_INF>(city_id).rel_rat.FindIndex(delegate(SUBSTU_REL_RAT temp) { return(temp.rel_id == DEFREL); });
            int         city_rel_num   = GetRelShip <STU_CITY_INF>(city_id).rel_rat[city_rel_index].rel_num;
            //效果 = 口才*4000+(宗教吸引力-王权)*2000-组织度*1000
            int attr_num = seer.m_eloquence * 4000 + (rel.m_attraction - country.m_crown) * 2000 - rel.m_organization * 1000;

            //减少对应无信仰人数,增加对应宗教人数
            if (attr_num > city_rel_num)
            {
                attr_num = city_rel_num;
            }
            SetCityRel(city.obj_id, DEFREL, -attr_num);
            SetCityRel(city.obj_id, rel.obj_id, attr_num);

            return(1);
        } //传教