Inheritance: Actor
コード例 #1
0
ファイル: StatusEffect.cs プロジェクト: Postremus/server
 void tick(Being target, int count)
 {
     //if (mScript)
     //{
     //    mScript.setMap(target.getMap());
     //    mScript.prepare("tick");
     //    mScript.push(target);
     //    mScript.push(count);
     //    mScript.execute();
     //}
 }
コード例 #2
0
ファイル: Being.cs プロジェクト: Invertika/server
        public Being(ThingType type)
            : base(type)
        {
            mAction=BeingAction.STAND;
            mTarget=null;
            mGender=BeingGender.GENDER_UNSPECIFIED;
            mDirection=BeingDirection.DOWN;

            Dictionary<int, List<AttributeInfoType>> attr=Program.attributeManager.getAttributeScope(ScopeType.BeingScope);
            Logger.Write(LogLevel.Debug, "Being creation: initialisation of {0} attributes.", attr.Count);

            foreach(KeyValuePair<int, List<AttributeInfoType>> pair in attr)
            {
                int debug=555; //TODO hier mal reinschauen
                //if(mAttributes.Count

                //if (mAttributes.count(it1.first))
                //    LOG_WARN("Redefinition of attribute '" << it1.first << "'!");
                //LOG_DEBUG("Attempting to create attribute '" << it1.first << "'.");
                //mAttributes.insert(std::make_pair(it1.first,
                //                                  Attribute(*it1.second)));
            }

            // TODO: Way to define default base values?
            // Should this be handled by the virtual modifiedAttribute?
            // URGENT either way

            //#if 0
            //    // Initialize element resistance to 100 (normal damage).
            //    for (i = BASE_ELEM_BEGIN; i < BASE_ELEM_END; ++i)
            //    {
            //        mAttributes[i] = Attribute(TY_ST);
            //        mAttributes[i].setBase(100);
            //    }
            //#endif
        }
コード例 #3
0
ファイル: Script.cs プロジェクト: Invertika/server
 bool performSpecialAction(int specialId, Being caster)
 {
     //if (Script *script = globalEventScript)
     //{
     //    script.prepare("use_special");
     //    script.push(caster);
     //    script.push(specialId);
     //    script.execute();
     //}
     return true;
 }
コード例 #4
0
ファイル: Script.cs プロジェクト: Invertika/server
 bool performCraft(Being crafter, List<InventoryItem> recipe)
 {
     //if (Script *script = globalEventScript)
     //{
     //    script.prepare("on_craft");
     //    script.push(crafter);
     //    script.push(recipe);
     //    script.execute();
     //}
     return true;
 }
コード例 #5
0
ファイル: Script.cs プロジェクト: Invertika/server
 bool executeGlobalEventFunction(string function, Being obj)
 {
     bool isScriptHandled=false;
     //if (Script *script = globalEventScript)
     //{
     //    script.setMap(obj.getMap());
     //    script.prepare(function);
     //    script.push(obj);
     //    script.execute();
     //    script.setMap(NULL);
     //    isScriptHandled = true; // TODO: don't set to true when execution failed
     //}
     return isScriptHandled;
 }
コード例 #6
0
ファイル: MapComposite.cs プロジェクト: Postremus/server
        ZoneIterator getAroundBeingIterator(Being obj, int radius)
        {
            //MapRegion r1;
            //mContent.fillRegion(r1, obj.getOldPosition(), radius);
            //MapRegion r2 = r1;
            //for (MapRegion::iterator i = r1.begin(), i_end = r1.end(); i != i_end; ++i)
            //{
            //    /* Fills region with destinations taken around the old position.
            //       This is necessary to detect two moving objects changing zones at the
            //       same time and at the border, and going in opposite directions (or
            //       more simply to detect teleportations, if any). */
            //    MapRegion &r4 = mContent.zones[*i].destinations;
            //    if (!r4.empty())
            //    {
            //        MapRegion r3;
            //        r3.reserve(r2.size() + r4.size());
            //        std::set_union(r2.begin(), r2.end(), r4.begin(), r4.end(),
            //                       std::back_insert_iterator< MapRegion >(r3));
            //        r2.swap(r3);
            //    }
            //}
            //mContent.fillRegion(r2, obj.getPosition(), radius);
            //return ZoneIterator(r2, mContent);

            return null; //ssk
        }
コード例 #7
0
ファイル: Being.cs プロジェクト: Invertika/server
        int performAttack(Being target, Damage damage)
        {
            //// check target legality
            //if (!target
            //        || target == this
            //        || target.getAction() == DEAD
            //        || !target.canFight())
            //    return -1;

            //if (getMap().getPvP() == PVP_NONE
            //        && target.getType() == OBJECT_CHARACTER
            //        && getType() == OBJECT_CHARACTER)
            //    return -1;

            //// check if target is in range using the pythagorean theorem
            //int distx = this.getPosition().x - target.getPosition().x;
            //int disty = this.getPosition().y - target.getPosition().y;
            //int distSquare = (distx * distx + disty * disty);
            //int maxDist = damage.range + target.getSize();
            //if (maxDist * maxDist < distSquare)
            //    return -1;

            //// Note: The auto-attack system will handle the delay between two attacks.

            //return (mTarget.damage(this, damage));

            return 0; //ssk
        }